From 8739ee7bd103a08d3d9408c0fd1270d80e95d82c Mon Sep 17 00:00:00 2001 From: tcharding Date: Tue, 3 Oct 2017 16:10:46 +1100 Subject: [PATCH] cmd: genutils: remove golint_failure entry `golint` emits warnings ``` exported function OutDir should have comment or be unexported. strings should not be capitalized or end with punctuation or a newline ``` - Add documentation comment to exported function OutDir. - Remove newline from error string. - Remove `hack\.golint_failures` entry for `cmd/genutils` --- cmd/genutils/genutils.go | 4 +++- hack/.golint_failures | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/genutils/genutils.go b/cmd/genutils/genutils.go index 309d6ec48f..c94b25db54 100644 --- a/cmd/genutils/genutils.go +++ b/cmd/genutils/genutils.go @@ -22,6 +22,8 @@ import ( "path/filepath" ) +// OutDir creates the absolute path name from path and checks path exists. +// Returns absolute path including trailing '/' or error if path does not exist. func OutDir(path string) (string, error) { outDir, err := filepath.Abs(path) if err != nil { @@ -34,7 +36,7 @@ func OutDir(path string) (string, error) { } if !stat.IsDir() { - return "", fmt.Errorf("output directory %s is not a directory\n", outDir) + return "", fmt.Errorf("output directory %s is not a directory", outDir) } outDir = outDir + "/" return outDir, nil diff --git a/hack/.golint_failures b/hack/.golint_failures index 570837c1f4..ccec46adc4 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -1,5 +1,4 @@ cluster/images/etcd-version-monitor -cmd/genutils cmd/gke-certificates-controller/app cmd/hyperkube cmd/kube-controller-manager/app