From ae63a87e216386dc1d9177a8ebba2749989f9e36 Mon Sep 17 00:00:00 2001 From: Ville Vesilehto Date: Fri, 31 Jan 2025 22:49:59 +0200 Subject: [PATCH] fix: correct spelling of marshal/unmarshal and linters-settings Previously linter settings were not read. Signed-off-by: Ville Vesilehto --- .golangci.yaml | 3 +-- internal/commands/create.go | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index acdb9d52..4d7eb39a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,5 +1,4 @@ - -linter-settings: +linters-settings: misspell: locale: US diff --git a/internal/commands/create.go b/internal/commands/create.go index 334dfb1f..91d16ced 100644 --- a/internal/commands/create.go +++ b/internal/commands/create.go @@ -403,15 +403,15 @@ func setMatchLabelsMatcher(constraint *unstructured.Unstructured, matcher rego.M } func setMatchExpressionsMatcher(constraint *unstructured.Unstructured, matcher []rego.MatchExpressionMatcher) error { - marshalled, err := json.Marshal(matcher) + marshaled, err := json.Marshal(matcher) if err != nil { return err } - var unmarshalled []interface{} - if err := json.Unmarshal(marshalled, &unmarshalled); err != nil { + var unmarshaled []interface{} + if err := json.Unmarshal(marshaled, &unmarshaled); err != nil { return err } - return unstructured.SetNestedSlice(constraint.Object, unmarshalled, "spec", "match", "labelSelector", "matchExpressions") + return unstructured.SetNestedSlice(constraint.Object, unmarshaled, "spec", "match", "labelSelector", "matchExpressions") } func setNestedStringSlice(constraint *unstructured.Unstructured, slice []string, path ...string) error {