Add and fix forbidigo

This commit is contained in:
Kristoffer Dalby 2021-11-15 18:36:02 +00:00
parent c4d4c9c4e4
commit db8be91d8b
No known key found for this signature in database
GPG key ID: 09F62DC067465735
4 changed files with 3 additions and 4 deletions

View file

@ -32,7 +32,6 @@ linters:
- wrapcheck - wrapcheck
- goerr113 - goerr113
- forcetypeassert - forcetypeassert
- forbidigo
- dupl - dupl
- makezero - makezero
- paralleltest - paralleltest

View file

@ -415,11 +415,13 @@ func SuccessOutput(result interface{}, override string, outputFormat string) {
log.Fatal().Err(err) log.Fatal().Err(err)
} }
default: default:
//nolint
fmt.Println(override) fmt.Println(override)
return return
} }
//nolint
fmt.Println(string(j)) fmt.Println(string(j))
} }

View file

@ -72,6 +72,7 @@ func main() {
} }
res, err := latest.Check(githubTag, cli.Version) res, err := latest.Check(githubTag, cli.Version)
if err == nil && res.Outdated { if err == nil && res.Outdated {
//nolint
fmt.Printf( 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", "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, res.Current,

View file

@ -1,7 +1,6 @@
package main package main
import ( import (
"fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
@ -112,7 +111,6 @@ func (*Suite) TestTLSConfigValidation(c *check.C) {
c.Fatal(err) c.Fatal(err)
} }
// defer os.RemoveAll(tmpDir) // defer os.RemoveAll(tmpDir)
fmt.Println(tmpDir)
configYaml := []byte( configYaml := []byte(
"---\ntls_letsencrypt_hostname: \"example.com\"\ntls_letsencrypt_challenge_type: \"\"\ntls_cert_path: \"abc.pem\"", "---\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, check.Matches,
".*Fatal config error: server_url must start with https:// or http://.*", ".*Fatal config error: server_url must start with https:// or http://.*",
) )
fmt.Println(tmp)
// Check configuration validation errors (2) // Check configuration validation errors (2)
configYaml = []byte( configYaml = []byte(