VOL-1978 - add golangci invocation and fixed issues it highlighted
Change-Id: I86f438f84e8ab7fae499a163d599b699c472afda
diff --git a/internal/pkg/commands/components.go b/internal/pkg/commands/components.go
index 2de4ee7..95cbd80 100644
--- a/internal/pkg/commands/components.go
+++ b/internal/pkg/commands/components.go
@@ -23,7 +23,7 @@
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
- "os"
+ "log"
)
const (
@@ -43,7 +43,9 @@
var componentOpts = ComponentOpts{}
func RegisterComponentCommands(parser *flags.Parser) {
- parser.AddCommand("component", "component instance commands", "Commands to query and manipulate VOLTHA component instances", &componentOpts)
+ if _, err := parser.AddCommand("component", "component instance commands", "Commands to query and manipulate VOLTHA component instances", &componentOpts); err != nil {
+ log.Fatalf("Unexpected error while attempting to register component commands : %s", err)
+ }
}
func (options *ComponentList) Execute(args []string) error {
@@ -100,10 +102,3 @@
GenerateOutput(&result)
return nil
}
-
-func homeDir() string {
- if h := os.Getenv("HOME"); h != "" {
- return h
- }
- return os.Getenv("USERPROFILE") // windows
-}