From 5d79a94bd0b35efd0c05671aec89f6a633f222cf Mon Sep 17 00:00:00 2001 From: Kevin Franklin Kim Date: Thu, 19 Sep 2024 14:35:57 +0200 Subject: [PATCH] fix: lint errors --- .golangci.yml | 1 - go.mod | 2 +- pkg/util/files/exists.go | 16 ---------------- pkg/util/prompt.go | 2 +- 4 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 pkg/util/files/exists.go diff --git a/.golangci.yml b/.golangci.yml index 5d57ff9..92b2874 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -133,7 +133,6 @@ linters: - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false] - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false] - exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false] - - exportloopref # checks for pointers to enclosing loop variables [fast: false, auto-fix: false] #- forbidigo # Forbids identifiers [fast: false, auto-fix: false] - forcetypeassert # finds forced type assertions [fast: true, auto-fix: false] - gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false] diff --git a/go.mod b/go.mod index ecab350..774d7f5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/foomo/posh -go 1.21.0 +go 1.23.0 require ( dario.cat/mergo v1.0.1 diff --git a/pkg/util/files/exists.go b/pkg/util/files/exists.go deleted file mode 100644 index 76b8388..0000000 --- a/pkg/util/files/exists.go +++ /dev/null @@ -1,16 +0,0 @@ -package files - -import ( - "os" - - "github.com/pkg/errors" -) - -func Exists(paths ...string) error { - for _, path := range paths { - if _, err := os.Stat(path); err != nil { - return errors.Wrapf(err, path) - } - } - return nil -} diff --git a/pkg/util/prompt.go b/pkg/util/prompt.go index 01a59f8..00b3dd8 100644 --- a/pkg/util/prompt.go +++ b/pkg/util/prompt.go @@ -8,7 +8,7 @@ import ( func Prompt(txt string) (string, error) { r := bufio.NewReader(os.Stdin) - if _, err := fmt.Fprintf(os.Stderr, txt+": "); err != nil { + if _, err := fmt.Fprint(os.Stderr, txt+": "); err != nil { return "", err } out, err := r.ReadString('\n')