From db8be91d8b0925459fbb3a8acfc5f97dfde7d727 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Mon, 15 Nov 2021 18:36:02 +0000 Subject: [PATCH] Add and fix forbidigo --- .golangci.yaml | 1 - cmd/headscale/cli/utils.go | 2 ++ cmd/headscale/headscale.go | 1 + cmd/headscale/headscale_test.go | 3 --- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 476c1c24..0a1b9dc2 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -32,7 +32,6 @@ linters: - wrapcheck - goerr113 - forcetypeassert - - forbidigo - dupl - makezero - paralleltest diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index a90a3c06..ed4b823c 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -415,11 +415,13 @@ func SuccessOutput(result interface{}, override string, outputFormat string) { log.Fatal().Err(err) } default: + //nolint fmt.Println(override) return } + //nolint fmt.Println(string(j)) } diff --git a/cmd/headscale/headscale.go b/cmd/headscale/headscale.go index f3352474..d6bf2166 100644 --- a/cmd/headscale/headscale.go +++ b/cmd/headscale/headscale.go @@ -72,6 +72,7 @@ func main() { } res, err := latest.Check(githubTag, cli.Version) if err == nil && res.Outdated { + //nolint fmt.Printf( "An updated version of Headscale has been found (%s vs. your current %s). Check it out https://github.com/juanfont/headscale/releases\n", res.Current, diff --git a/cmd/headscale/headscale_test.go b/cmd/headscale/headscale_test.go index 0d1b9a13..1166d489 100644 --- a/cmd/headscale/headscale_test.go +++ b/cmd/headscale/headscale_test.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "io/ioutil" "os" "path/filepath" @@ -112,7 +111,6 @@ func (*Suite) TestTLSConfigValidation(c *check.C) { c.Fatal(err) } // defer os.RemoveAll(tmpDir) - fmt.Println(tmpDir) configYaml := []byte( "---\ntls_letsencrypt_hostname: \"example.com\"\ntls_letsencrypt_challenge_type: \"\"\ntls_cert_path: \"abc.pem\"", @@ -139,7 +137,6 @@ func (*Suite) TestTLSConfigValidation(c *check.C) { check.Matches, ".*Fatal config error: server_url must start with https:// or http://.*", ) - fmt.Println(tmp) // Check configuration validation errors (2) configYaml = []byte(