From 4215989abb4b309750fe367afac1b3a4d9ae4706 Mon Sep 17 00:00:00 2001 From: Robert Grandl Date: Fri, 23 Aug 2024 10:45:25 -0700 Subject: [PATCH] Fix linter issues --- .github/workflows/go.yml | 2 +- cmd/weaver/main.go | 2 +- dev/build_and_test | 2 +- internal/net/call/stub_test.go | 2 +- runtime/codegen/encoder_test.go | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c746cb5f42..59338e369d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -85,7 +85,7 @@ jobs: if: ${{ matrix.command == 'lint' }} - name: Install linter - run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.6 + run: go install honnef.co/go/tools/cmd/staticcheck@v0.5.0 if: ${{ matrix.command == 'lint' }} - name: Build the weaver binary diff --git a/cmd/weaver/main.go b/cmd/weaver/main.go index edd59f60ea..240faff703 100644 --- a/cmd/weaver/main.go +++ b/cmd/weaver/main.go @@ -165,7 +165,7 @@ func run(deployer string, args []string) (int, error) { binary := "weaver-" + deployer if _, err := exec.LookPath(binary); err != nil { msg := fmt.Sprintf(`"weaver %s" is not a weaver command. See "weaver --help". If you're trying to invoke a custom deployer, the %q binary was not found. You may need to install the %q binary or add it to your PATH.`, deployer, binary, binary) - return 1, fmt.Errorf(wrap(msg, 80)) + return 1, fmt.Errorf("%s", wrap(msg, 80)) } cmd := exec.Command(binary, args...) cmd.Stdin = os.Stdin diff --git a/dev/build_and_test b/dev/build_and_test index 3f9860ab0a..5137211379 100755 --- a/dev/build_and_test +++ b/dev/build_and_test @@ -54,7 +54,7 @@ function cmd_vet() { function cmd_lint() { if ! exists staticcheck; then - printf "staticcheck not found; install via\ngo install honnef.co/go/tools/cmd/staticcheck@v0.4.6\n" >&2 + printf "staticcheck not found; install via\ngo install honnef.co/go/tools/cmd/staticcheck@v0.5.0\n" >&2 exit 1 fi diff --git a/internal/net/call/stub_test.go b/internal/net/call/stub_test.go index 490c81e87a..aa8e62f168 100644 --- a/internal/net/call/stub_test.go +++ b/internal/net/call/stub_test.go @@ -188,7 +188,7 @@ func TestErrorArgsNotEncoded(t *testing.T) { }) if !strings.Contains(err.Error(), "decoder: unable to read") { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } } diff --git a/runtime/codegen/encoder_test.go b/runtime/codegen/encoder_test.go index bb73a4ee73..ff2a546823 100644 --- a/runtime/codegen/encoder_test.go +++ b/runtime/codegen/encoder_test.go @@ -144,7 +144,7 @@ func TestErrorDecUnableToRead(t *testing.T) { dec.Bool() }) if !strings.Contains(err.Error(), "unable to read #bytes") { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } } @@ -160,7 +160,7 @@ func TestErrorUnableToDecBool(t *testing.T) { dec.Bool() }) if !strings.Contains(err.Error(), "unable to decode bool") { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } } @@ -176,7 +176,7 @@ func TestErrorUnableToDecBytes(t *testing.T) { dec.Bytes() }) if !strings.Contains(err.Error(), "unable to decode bytes; expected length") { - t.Fatalf(err.Error()) + t.Fatal(err.Error()) } }