diff --git a/pkg/fieldpath/fieldpath.go b/pkg/fieldpath/fieldpath.go index 0eba1aafdac..d1f978e8a1b 100644 --- a/pkg/fieldpath/fieldpath.go +++ b/pkg/fieldpath/fieldpath.go @@ -23,12 +23,12 @@ import ( ) // formatMap formats map[string]string to a string. -func formatMap(m map[string]string) string { - var l string +func formatMap(m map[string]string) (fmtStr string) { for key, value := range m { - l += key + "=" + fmt.Sprintf("%q", value) + "\n" + fmtStr += fmt.Sprintf("%v=%q\n", key, value) } - return l + + return } // ExtractFieldPathAsString extracts the field from the given object