Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
Small code improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
StiviiK committed May 27, 2020
1 parent a700217 commit 0c3b585
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/github/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func wrapReadParametersJSON(v string) (interface{}, error) {
return json, err
}

// Check if the parameters are wrapped
// Check if the parameters are wrapped (https://github.com/Azure/azure-sdk-for-go/issues/9283)
paramters, ok := json["parameters"]
if ok {
return paramters, nil
Expand Down
17 changes: 7 additions & 10 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,17 @@ func ReadJSON(path string) (map[string]interface{}, error) {

// MergeParameters takes the original and override parameters and merges them together
func MergeParameters(original map[string]interface{}, override map[string]interface{}) map[string]interface{} {
if original == nil && override == nil {
switch {
case original == nil && override == nil:
return make(map[string]interface{})
}

if original == nil {
case original == nil:
return override
}

if override == nil {
case override == nil:
return original
}

if len(override) == 0 {
case len(override) == 0:
return original
default:
break
}

for key, value := range override {
Expand Down

0 comments on commit 0c3b585

Please sign in to comment.