From ac06001ca28b1563726b91e542fb76b899eea238 Mon Sep 17 00:00:00 2001 From: Tamer Tas Date: Tue, 8 Dec 2015 09:08:45 +0200 Subject: [PATCH] Refactor formatMap method --- pkg/fieldpath/fieldpath.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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