From 27dc8a9b631240b4e96956ee6545714f25347a7c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 22 Jul 2022 09:19:47 -0400 Subject: [PATCH] Fix quotes that trip up gofmt Signed-off-by: Davanum Srinivas --- pkg/fieldpath/fieldpath.go | 15 ++++++++------- .../kubectl/pkg/util/fieldpath/fieldpath.go | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pkg/fieldpath/fieldpath.go b/pkg/fieldpath/fieldpath.go index a104a70bc73..20fa8eaaaae 100644 --- a/pkg/fieldpath/fieldpath.go +++ b/pkg/fieldpath/fieldpath.go @@ -84,15 +84,16 @@ func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error) // SplitMaybeSubscriptedPath checks whether the specified fieldPath is // subscripted, and -// - if yes, this function splits the fieldPath into path and subscript, and -// returns (path, subscript, true). -// - if no, this function returns (fieldPath, "", false). +// - if yes, this function splits the fieldPath into path and subscript, and +// returns (path, subscript, true). +// - if no, this function returns (fieldPath, "", false). // // Example inputs and outputs: -// - "metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true) -// - "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true) -// - "metadata.labels['']" --> ("metadata.labels", "", true) -// - "metadata.labels" --> ("metadata.labels", "", false) +// +// "metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true) +// "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true) +// "metadata.labels['']" --> ("metadata.labels", "", true) +// "metadata.labels" --> ("metadata.labels", "", false) func SplitMaybeSubscriptedPath(fieldPath string) (string, string, bool) { if !strings.HasSuffix(fieldPath, "']") { return fieldPath, "", false diff --git a/staging/src/k8s.io/kubectl/pkg/util/fieldpath/fieldpath.go b/staging/src/k8s.io/kubectl/pkg/util/fieldpath/fieldpath.go index efd08cde0f5..af512af8c8c 100644 --- a/staging/src/k8s.io/kubectl/pkg/util/fieldpath/fieldpath.go +++ b/staging/src/k8s.io/kubectl/pkg/util/fieldpath/fieldpath.go @@ -86,15 +86,16 @@ func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error) // SplitMaybeSubscriptedPath checks whether the specified fieldPath is // subscripted, and -// - if yes, this function splits the fieldPath into path and subscript, and -// returns (path, subscript, true). -// - if no, this function returns (fieldPath, "", false). +// - if yes, this function splits the fieldPath into path and subscript, and +// returns (path, subscript, true). +// - if no, this function returns (fieldPath, "", false). // // Example inputs and outputs: -// - "metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true) -// - "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true) -// - "metadata.labels['']" --> ("metadata.labels", "", true) -// - "metadata.labels" --> ("metadata.labels", "", false) +// +// "metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true) +// "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true) +// "metadata.labels['']" --> ("metadata.labels", "", true) +// "metadata.labels" --> ("metadata.labels", "", false) func SplitMaybeSubscriptedPath(fieldPath string) (string, string, bool) { if !strings.HasSuffix(fieldPath, "']") { return fieldPath, "", false