diff --git a/internal/config/load.go b/internal/config/load.go index 251ea411..24c9d225 100644 --- a/internal/config/load.go +++ b/internal/config/load.go @@ -476,7 +476,7 @@ func mergeActions(src, dest map[string]interface{}) error { } func mergeActionsSlice(src, dest []interface{}) []interface{} { - mergable := make(map[string]map[string]interface{}) + mergeable := make(map[string]map[string]interface{}) result := make([]interface{}, 0, len(dest)) for _, maybeAction := range dest { @@ -484,7 +484,7 @@ func mergeActionsSlice(src, dest []interface{}) []interface{} { case map[string]interface{}: switch name := destAction["name"].(type) { case string: - mergable[name] = destAction + mergeable[name] = destAction default: } @@ -498,7 +498,7 @@ func mergeActionsSlice(src, dest []interface{}) []interface{} { case map[string]interface{}: switch name := srcAction["name"].(type) { case string: - destAction, ok := mergable[name] + destAction, ok := mergeable[name] if ok { var srcSubActions []interface{} var destSubActions []interface{} diff --git a/internal/config/load_test.go b/internal/config/load_test.go index 53a6a250..672bdb81 100644 --- a/internal/config/load_test.go +++ b/internal/config/load_test.go @@ -732,9 +732,9 @@ pre-commit: Hooks: map[string]*Hook{ "pre-commit": { Actions: []*Action{ - &Action{Run: "1"}, - &Action{Run: "local 2", Name: "second"}, - &Action{Run: "3"}, + {Run: "1"}, + {Run: "local 2", Name: "second"}, + {Run: "3"}, }, }, }, @@ -781,26 +781,26 @@ pre-commit: Hooks: map[string]*Hook{ "pre-commit": { Actions: []*Action{ - &Action{ + { Name: "group 1", Glob: "*.rb", Group: &Group{ Parallel: true, Actions: []*Action{ - &Action{Run: "1.1"}, - &Action{Run: "1.2"}, - &Action{ + {Run: "1.1"}, + {Run: "1.2"}, + { Name: "nested", Group: &Group{ Actions: []*Action{ - &Action{Run: "1.nested.1"}, - &Action{Run: "1.nested.2 local", Name: "nested 2"}, - &Action{Run: "1.nested.3"}, + {Run: "1.nested.1"}, + {Run: "1.nested.2 local", Name: "nested 2"}, + {Run: "1.nested.3"}, }, }, }, - &Action{Run: "1.3"}, - &Action{Run: "1.4"}, + {Run: "1.3"}, + {Run: "1.4"}, }, }, },