Fix go lint error and add golint checks to a pre-commit hook

This commit is contained in:
Oleg Atamanenko
2018-06-09 23:05:26 -04:00
parent 2b05d39067
commit c994130005
18 changed files with 58 additions and 24 deletions

View File

@@ -27,7 +27,7 @@ import (
"k8s.io/apimachinery/pkg/util/validation"
)
// handleConfigMapFromLiteralSources adds the specified literal source
// HandleConfigMapFromLiteralSources adds the specified literal source
// information into the provided configMap.
func HandleConfigMapFromLiteralSources(configMap *v1.ConfigMap, literalSources []string) error {
for _, literalSource := range literalSources {
@@ -43,7 +43,7 @@ func HandleConfigMapFromLiteralSources(configMap *v1.ConfigMap, literalSources [
return nil
}
// handleConfigMapFromFileSources adds the specified file source information
// HandleConfigMapFromFileSources adds the specified file source information
// into the provided configMap
func HandleConfigMapFromFileSources(configMap *v1.ConfigMap, fileSources []string) error {
for _, fileSource := range fileSources {
@@ -88,7 +88,7 @@ func HandleConfigMapFromFileSources(configMap *v1.ConfigMap, fileSources []strin
return nil
}
// handleConfigMapFromEnvFileSource adds the specified env file source information
// HandleConfigMapFromEnvFileSource adds the specified env file source information
// into the provided configMap
func HandleConfigMapFromEnvFileSource(configMap *v1.ConfigMap, envFileSource string) error {
info, err := os.Stat(envFileSource)

View File

@@ -41,6 +41,7 @@ func ParseRFC3339(s string, nowFn func() metav1.Time) (metav1.Time, error) {
return metav1.Time{Time: t}, nil
}
// HashObject encodes object using given codec and returns MD5 sum of the result.
func HashObject(obj runtime.Object, codec runtime.Codec) (string, error) {
data, err := runtime.Encode(codec, obj)
if err != nil {