Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove committed Apr 7, 2021
1 parent 6d11400 commit e107128
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/cluster/spec/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,23 @@ func FlattenMap(ms map[string]interface{}) map[string]interface{} {
return result
}

// MergeConfig merge two or more config into one and unflat them
// config1:
// a.b.a: 1
// a.b.b: 2
// config2:
// a.b.a: 3
// a.b.c: 4
// config3:
// b.c = 5
// After MergeConfig(config1, config2, config3):
// a:
// b:
// a: 3
// b: 2
// c: 4
// b:
// c: 5
func MergeConfig(orig map[string]interface{}, overwrites ...map[string]interface{}) map[string]interface{} {
lhs := FoldMap(orig)
for _, overwrite := range overwrites {
Expand Down

0 comments on commit e107128

Please sign in to comment.