From eb200ddd81fa8a9f613e7f08ea368ddbf2a6318f Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Thu, 16 Mar 2023 19:59:04 +0100 Subject: [PATCH] Fix minor linting issues --- cmd/whatismyip.go | 2 +- internal/setting/app.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/whatismyip.go b/cmd/whatismyip.go index c3c1860..85e0532 100644 --- a/cmd/whatismyip.go +++ b/cmd/whatismyip.go @@ -33,7 +33,7 @@ func main() { fmt.Print(o) os.Exit(0) } else if err != nil { - fmt.Print(err) + fmt.Println(err) os.Exit(1) } diff --git a/internal/setting/app.go b/internal/setting/app.go index d303ead..779ffe2 100644 --- a/internal/setting/app.go +++ b/internal/setting/app.go @@ -100,24 +100,24 @@ func Setup(args []string) (output string, err error) { } if App.TrustedPortHeader != "" && App.TrustedHeader == "" { - return "", fmt.Errorf("truster-header is mandatory when truster-port-header is set\n") + return "", fmt.Errorf("truster-header is mandatory when truster-port-header is set") } if App.GeodbPath.City == "" || App.GeodbPath.ASN == "" { - return "", fmt.Errorf("geoip2-city and geoip2-asn parameters are mandatory\n") + return "", fmt.Errorf("geoip2-city and geoip2-asn parameters are mandatory") } if (App.TLSAddress != "") && (App.TLSCrtPath == "" || App.TLSKeyPath == "") { - return "", fmt.Errorf("In order to use TLS -tls-crt and -tls-key flags are mandatory\n") + return "", fmt.Errorf("in order to use TLS, the -tls-crt and -tls-key flags are mandatory") } if App.TemplatePath != "" { info, err := os.Stat(App.TemplatePath) if os.IsNotExist(err) { - return "", fmt.Errorf("%s no such file or directory\n", App.TemplatePath) + return "", fmt.Errorf("%s no such file or directory", App.TemplatePath) } if info.IsDir() { - return "", fmt.Errorf("%s must be a file\n", App.TemplatePath) + return "", fmt.Errorf("%s must be a file", App.TemplatePath) } }