chore(go-lint): fix golint warning (#133)

Fixes several go lint cases reported by go report. 

Signed-off-by: wiwen <shenggxhz@gmail.com>
This commit is contained in:
wiwen 2020-06-09 17:17:23 +08:00 committed by GitHub
parent 639ead416e
commit f5ae3ff476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 78 additions and 51 deletions

View file

@ -22,7 +22,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Namespacegetter abstracts fetching of Namespace from kubernetes cluster
// NamespaceGetter abstracts fetching of Namespace from kubernetes cluster
type NamespaceGetter interface {
Get(name string, options metav1.GetOptions) (*corev1.Namespace, error)
}
@ -43,9 +43,8 @@ func (ns *namespace) Get(name string, options metav1.GetOptions) (*corev1.Namesp
cs, err := Clientset().Get()
if err != nil {
return nil, errors.Wrapf(err, "failed to get namespace: %s", name)
} else {
return cs.CoreV1().Namespaces().Get(name, options)
}
return cs.CoreV1().Namespaces().Get(name, options)
}
// List returns a slice of namespaces defined in a Kubernetes cluster
@ -53,7 +52,6 @@ func (ns *namespace) List(options metav1.ListOptions) (*corev1.NamespaceList, er
cs, err := Clientset().Get()
if err != nil {
return nil, errors.Wrapf(err, "failed to get namespaces")
} else {
return cs.CoreV1().Namespaces().List(options)
}
return cs.CoreV1().Namespaces().List(options)
}