From 27f61cb28be6922be790a695441d6bc3fe47a255 Mon Sep 17 00:00:00 2001 From: yuexiao-wang Date: Wed, 12 Oct 2016 03:32:50 +0800 Subject: [PATCH] Update function name for public function in commend Signed-off-by: yuexiao-wang --- pkg/fieldpath/fieldpath.go | 6 +++--- pkg/fieldpath/fieldpath_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/fieldpath/fieldpath.go b/pkg/fieldpath/fieldpath.go index 8ca13ef1007..d49da8a32de 100644 --- a/pkg/fieldpath/fieldpath.go +++ b/pkg/fieldpath/fieldpath.go @@ -63,7 +63,7 @@ func ExtractFieldPathAsString(obj interface{}, fieldPath string) (string, error) return accessor.GetNamespace(), nil } - return "", fmt.Errorf("Unsupported fieldPath: %v", fieldPath) + return "", fmt.Errorf("unsupported fieldPath: %v", fieldPath) } // TODO: move the functions below to pkg/api/util/resources @@ -146,7 +146,7 @@ func InternalExtractContainerResourceValue(fs *api.ResourceFieldSelector, contai return convertResourceMemoryToString(container.Resources.Requests.Memory(), divisor) } - return "", fmt.Errorf("Unsupported container resource : %v", fs.Resource) + return "", fmt.Errorf("unsupported container resource : %v", fs.Resource) } // findContainerInPod finds a container by its name in the provided pod @@ -159,7 +159,7 @@ func findContainerInPod(pod *v1.Pod, containerName string) (*v1.Container, error return nil, fmt.Errorf("container %s not found", containerName) } -// convertResourceCPUTOString converts cpu value to the format of divisor and returns +// convertResourceCPUToString converts cpu value to the format of divisor and returns // ceiling of the value. func convertResourceCPUToString(cpu *resource.Quantity, divisor resource.Quantity) (string, error) { c := int64(math.Ceil(float64(cpu.MilliValue()) / float64(divisor.MilliValue()))) diff --git a/pkg/fieldpath/fieldpath_test.go b/pkg/fieldpath/fieldpath_test.go index 6fa865edb11..14121ffcd77 100644 --- a/pkg/fieldpath/fieldpath_test.go +++ b/pkg/fieldpath/fieldpath_test.go @@ -99,7 +99,7 @@ func TestExtractFieldPathAsString(t *testing.T) { Namespace: "object-namespace", }, }, - expectedMessageFragment: "Unsupported fieldPath", + expectedMessageFragment: "unsupported fieldPath", }, } @@ -108,13 +108,13 @@ func TestExtractFieldPathAsString(t *testing.T) { if err != nil { if tc.expectedMessageFragment != "" { if !strings.Contains(err.Error(), tc.expectedMessageFragment) { - t.Errorf("%v: Unexpected error message: %q, expected to contain %q", tc.name, err, tc.expectedMessageFragment) + t.Errorf("%v: unexpected error message: %q, expected to contain %q", tc.name, err, tc.expectedMessageFragment) } } else { t.Errorf("%v: unexpected error: %v", tc.name, err) } } else if e := tc.expectedValue; e != "" && e != actual { - t.Errorf("%v: Unexpected result; got %q, expected %q", tc.name, actual, e) + t.Errorf("%v: unexpected result; got %q, expected %q", tc.name, actual, e) } } }