From c00d8b37c856f706d0083db063a31456c86fc514 Mon Sep 17 00:00:00 2001 From: Cornelius Weig Date: Wed, 9 Oct 2019 21:46:24 +0200 Subject: [PATCH] Fix issues found by new linter version --- cmd/minikube/cmd/start.go | 15 +++++++-------- cmd/minikube/cmd/update-check.go | 4 ---- cmd/minikube/cmd/version.go | 4 ---- pkg/minikube/extract/extract.go | 8 ++++---- pkg/minikube/tunnel/tunnel_manager.go | 4 ++-- 5 files changed, 13 insertions(+), 22 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 9adf964c34..62ef4eda49 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -119,14 +119,13 @@ const ( ) var ( - registryMirror []string - dockerEnv []string - dockerOpt []string - insecureRegistry []string - apiServerNames []string - apiServerIPs []net.IP - extraOptions cfg.ExtraOptionSlice - enableUpdateNotification = true + registryMirror []string + dockerEnv []string + dockerOpt []string + insecureRegistry []string + apiServerNames []string + apiServerIPs []net.IP + extraOptions cfg.ExtraOptionSlice ) func init() { diff --git a/cmd/minikube/cmd/update-check.go b/cmd/minikube/cmd/update-check.go index 5fab5cfe05..ec519cae35 100644 --- a/cmd/minikube/cmd/update-check.go +++ b/cmd/minikube/cmd/update-check.go @@ -28,10 +28,6 @@ var updateCheckCmd = &cobra.Command{ Use: "update-check", Short: "Print current and latest version number", Long: `Print current and latest version number`, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - // Explicitly disable update checking for the version command - enableUpdateNotification = false - }, Run: func(command *cobra.Command, args []string) { url := notify.GithubMinikubeReleasesURL r, err := notify.GetAllVersionsFromURL(url) diff --git a/cmd/minikube/cmd/version.go b/cmd/minikube/cmd/version.go index a7cb944d0d..00c61efd88 100644 --- a/cmd/minikube/cmd/version.go +++ b/cmd/minikube/cmd/version.go @@ -26,10 +26,6 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "Print the version of minikube", Long: `Print the version of minikube.`, - PersistentPreRun: func(cmd *cobra.Command, args []string) { - // Explicitly disable update checking for the version command - enableUpdateNotification = false - }, Run: func(command *cobra.Command, args []string) { out.Ln("minikube version: %v", version.GetVersion()) gitCommitID := version.GetGitCommitID() diff --git a/pkg/minikube/extract/extract.go b/pkg/minikube/extract/extract.go index 55a8969724..8453d53ea5 100644 --- a/pkg/minikube/extract/extract.go +++ b/pkg/minikube/extract/extract.go @@ -385,7 +385,7 @@ func checkKeyValueExpression(kvp *ast.KeyValueExpr, e *state) { // Ok now this is just a mess if help, ok := kvp.Value.(*ast.BinaryExpr); ok { - s := checkBinaryExpression(help, e) + s := checkBinaryExpression(help) if s != "" { e.translations[s] = "" } @@ -394,7 +394,7 @@ func checkKeyValueExpression(kvp *ast.KeyValueExpr, e *state) { } // checkBinaryExpression checks binary expressions, stuff of the form x + y, for strings and concats them -func checkBinaryExpression(b *ast.BinaryExpr, e *state) string { +func checkBinaryExpression(b *ast.BinaryExpr) string { // Check the left side var s string if l, ok := b.X.(*ast.BasicLit); ok { @@ -410,7 +410,7 @@ func checkBinaryExpression(b *ast.BinaryExpr, e *state) string { } if b1, ok := b.X.(*ast.BinaryExpr); ok { - if x := checkBinaryExpression(b1, e); x != "" { + if x := checkBinaryExpression(b1); x != "" { s += x } } @@ -429,7 +429,7 @@ func checkBinaryExpression(b *ast.BinaryExpr, e *state) string { } if b1, ok := b.Y.(*ast.BinaryExpr); ok { - if x := checkBinaryExpression(b1, e); x != "" { + if x := checkBinaryExpression(b1); x != "" { s += x } } diff --git a/pkg/minikube/tunnel/tunnel_manager.go b/pkg/minikube/tunnel/tunnel_manager.go index 69f9e972b1..4c3ed6f4d9 100644 --- a/pkg/minikube/tunnel/tunnel_manager.go +++ b/pkg/minikube/tunnel/tunnel_manager.go @@ -122,8 +122,8 @@ func (mgr *Manager) run(ctx context.Context, t controller, ready, check, done ch } } -func (mgr *Manager) cleanup(t controller) *Status { - return t.cleanup() +func (mgr *Manager) cleanup(t controller) { + t.cleanup() } // CleanupNotRunningTunnels cleans up tunnels that are not running