-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #808 from hashicorp/base-controller-5
Split out baseController from TasksManager pt2
- Loading branch information
Showing
17 changed files
with
1,047 additions
and
576 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package config | ||
|
||
func mergeMaps(c, o map[string]interface{}) map[string]interface{} { | ||
r := make(map[string]interface{}) | ||
for k, v := range c { | ||
r[k] = v | ||
} | ||
|
||
for k, v := range o { | ||
r[k] = v | ||
} | ||
|
||
return r | ||
} | ||
|
||
func mergeSlices(orig, incoming []string) []string { | ||
if orig == nil { | ||
if incoming == nil { | ||
return nil | ||
} | ||
return incoming | ||
} | ||
|
||
if incoming == nil { | ||
return orig | ||
} | ||
|
||
for _, incomingVal := range incoming { | ||
// only add an incoming value if it does not already exist in the | ||
// original slice | ||
exists := false | ||
for _, origVal := range orig { | ||
if incomingVal == origVal { | ||
exists = true | ||
break | ||
} | ||
} | ||
|
||
if !exists { | ||
orig = append(orig, incomingVal) | ||
} | ||
} | ||
|
||
return orig | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.