Fix quotes that trip up gofmt

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 27dc8a9b631240b4e96956ee6545714f25347a7c
This commit is contained in:
Davanum Srinivas 2022-07-22 09:19:47 -04:00 committed by Kubernetes Publisher
parent cfcf001815
commit 8efbb6da95
1 changed files with 8 additions and 7 deletions

View File

@ -91,10 +91,11 @@ func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error)
// - if no, this function returns (fieldPath, "", false). // - if no, this function returns (fieldPath, "", false).
// //
// Example inputs and outputs: // Example inputs and outputs:
// - "metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true) //
// - "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true) // "metadata.annotations['myKey']" --> ("metadata.annotations", "myKey", true)
// - "metadata.labels['']" --> ("metadata.labels", "", true) // "metadata.annotations['a[b]c']" --> ("metadata.annotations", "a[b]c", true)
// - "metadata.labels" --> ("metadata.labels", "", false) // "metadata.labels['']" --> ("metadata.labels", "", true)
// "metadata.labels" --> ("metadata.labels", "", false)
func SplitMaybeSubscriptedPath(fieldPath string) (string, string, bool) { func SplitMaybeSubscriptedPath(fieldPath string) (string, string, bool) {
if !strings.HasSuffix(fieldPath, "']") { if !strings.HasSuffix(fieldPath, "']") {
return fieldPath, "", false return fieldPath, "", false