mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
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:
parent
639ead416e
commit
f5ae3ff476
25 changed files with 78 additions and 51 deletions
3
pkg/common/env/env.go
vendored
3
pkg/common/env/env.go
vendored
|
|
@ -64,9 +64,8 @@ func GetOrDefault(e string, defaultValue string) (value string) {
|
|||
if len(envValue) == 0 {
|
||||
// ENV not defined or set to ""
|
||||
return defaultValue
|
||||
} else {
|
||||
return envValue
|
||||
}
|
||||
return envValue
|
||||
}
|
||||
|
||||
// Lookup looks up an environment variable
|
||||
|
|
|
|||
|
|
@ -212,11 +212,12 @@ func (c *Client) Config() (config *rest.Config, err error) {
|
|||
return c.getInClusterConfig()
|
||||
}
|
||||
|
||||
// ConfigForPath returns the kuberentes config instance based on KubeConfig path
|
||||
// ConfigForPath returns the kubernetes config instance based on KubeConfig path
|
||||
func (c *Client) ConfigForPath(kubeConfigPath string) (config *rest.Config, err error) {
|
||||
return c.buildConfigFromFlags("", kubeConfigPath)
|
||||
}
|
||||
|
||||
// GetConfigForPathOrDirect returns the kubernetes config instance based on direct KubeConfig
|
||||
func (c *Client) GetConfigForPathOrDirect() (config *rest.Config, err error) {
|
||||
if c.KubeConfigPath != "" {
|
||||
return c.ConfigForPath(c.KubeConfigPath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue