From 62690ab52e6366cab6009b7c0f3d2f4ec6f1e794 Mon Sep 17 00:00:00 2001 From: max furman Date: Thu, 3 Feb 2022 12:23:02 -0800 Subject: [PATCH] Fix linting errors and pin linter version in release action --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- authority/ssh_test.go | 8 ++++---- errs/error.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6da2aa27..5d0416ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: uses: golangci/golangci-lint-action@v2 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: 'latest' + version: 'v1.44.0' # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10e7360d..f36e78ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: uses: golangci/golangci-lint-action@v2 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: 'v1.43.0' + version: 'v1.44.0' # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/authority/ssh_test.go b/authority/ssh_test.go index 2ea65352..c299b347 100644 --- a/authority/ssh_test.go +++ b/authority/ssh_test.go @@ -57,7 +57,7 @@ func (m sshTestCertModifier) Modify(cert *ssh.Certificate, opts provisioner.Sign if m == "" { return nil } - return fmt.Errorf(string(m)) + return errors.New(string(m)) } type sshTestCertValidator string @@ -66,7 +66,7 @@ func (v sshTestCertValidator) Valid(crt *ssh.Certificate, opts provisioner.SignS if v == "" { return nil } - return fmt.Errorf(string(v)) + return errors.New(string(v)) } type sshTestOptionsValidator string @@ -75,7 +75,7 @@ func (v sshTestOptionsValidator) Valid(opts provisioner.SignSSHOptions) error { if v == "" { return nil } - return fmt.Errorf(string(v)) + return errors.New(string(v)) } type sshTestOptionsModifier string @@ -84,7 +84,7 @@ func (m sshTestOptionsModifier) Modify(cert *ssh.Certificate, opts provisioner.S if m == "" { return nil } - return fmt.Errorf(string(m)) + return errors.New(string(m)) } func TestAuthority_initHostOnly(t *testing.T) { diff --git a/errs/error.go b/errs/error.go index 2c1fe6a9..b5287cc1 100644 --- a/errs/error.go +++ b/errs/error.go @@ -142,7 +142,7 @@ func (e *Error) UnmarshalJSON(data []byte) error { return err } e.Status = er.Status - e.Err = fmt.Errorf(er.Message) + e.Err = errors.New(er.Message) return nil }