diff --git a/tkg/tkgconfigproviders/helper.go b/tkg/tkgconfigproviders/helper.go index 25877f1f6d..cd381b7c9e 100644 --- a/tkg/tkgconfigproviders/helper.go +++ b/tkg/tkgconfigproviders/helper.go @@ -13,8 +13,8 @@ func mapToConfigString(data map[string]string) string { result := "" for key, value := range data { if len(key) > 0 { - result += key + ":" + value + "," - } + result += key + ":" + value + "," + } } result = strings.TrimSuffix(result, ",") return result diff --git a/tkg/tkgconfigproviders/helper_test.go b/tkg/tkgconfigproviders/helper_test.go index 12ca5bbd4c..99478dff71 100644 --- a/tkg/tkgconfigproviders/helper_test.go +++ b/tkg/tkgconfigproviders/helper_test.go @@ -24,10 +24,10 @@ func TestMapToConfigString(t *testing.T) { target := map[string]string{"key1": "value1", "key2": "value2"} result := mapToConfigString(target) shouldContain(t, result, "key1:value1") - shouldContain(t, result, "key2:value2") - if strings.LastIndex(result, ",") == len(result)-1 { - t.Fatalf("Test with two keys detected ending comma: \"%s\"", result) - } + shouldContain(t, result, "key2:value2") + if strings.LastIndex(result, ",") == len(result)-1 { + t.Fatalf("Test with two keys detected ending comma: \"%s\"", result) + } result = mapToConfigString(nil) shouldBeBlank(t, result, "sending nil") @@ -100,9 +100,9 @@ func TestConfigStringToMap(t *testing.T) { result = configStringToMap(target) shouldHaveTwoEntries(t, target, result, "key1", "value1", "key2", "value2") - target = "key1:value1,key2:value2" - result = configStringToMap(target) - shouldHaveTwoEntries(t, target, result, "key1", "value1", "key2", "value2") + target = "key1:value1,key2:value2" + result = configStringToMap(target) + shouldHaveTwoEntries(t, target, result, "key1", "value1", "key2", "value2") } type testStruct struct {