Skip to content

Commit

Permalink
CI: update staticcheck and gofumpt
Browse files Browse the repository at this point in the history
The newer staticcheck finds a few more issues.
  • Loading branch information
mvdan authored and altergui committed Aug 19, 2024
1 parent d06bda9 commit 2472f4a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fi
- name: Run gofumpt
# Run gofumpt first, as it's quick and issues are common.
run: diff -u <(echo -n) <(go run mvdan.cc/gofumpt@v0.5.0 -d .)
run: diff -u <(echo -n) <(go run mvdan.cc/gofumpt@v0.7.0 -d .)
- name: Run go vet
run: go vet ./...
- name: Run go generate
Expand All @@ -54,7 +54,7 @@ jobs:
fi
- name: Run staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@2023.1.7
go install honnef.co/go/tools/cmd/staticcheck@2024.1.1
staticcheck -debug.version
staticcheck ./... 2> staticcheck-stderr
- name: Check staticcheck stderr (this step isn't needed because we are using actions/setup-go@v5 on GitHub hosted runner)
Expand Down
5 changes: 2 additions & 3 deletions vochain/proof_erc20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package vochain
import (
"context"
"encoding/json"
"fmt"
"testing"

cometabcitypes "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -117,7 +116,7 @@ func testEthSendVotes(t *testing.T, s testStorageProof,
cktxresp, _ = app.CheckTx(context.Background(), cktx)
if cktxresp.Code != 0 {
if expectedResult {
t.Fatalf(fmt.Sprintf("checkTx failed: %s", cktxresp.Data))
t.Fatalf("checkTx failed: %s", cktxresp.Data)
}
} else {
if !expectedResult {
Expand All @@ -132,7 +131,7 @@ func testEthSendVotes(t *testing.T, s testStorageProof,
detxresp := app.deliverTx(txb)
if detxresp.Code != 0 {
if expectedResult {
t.Fatalf(fmt.Sprintf("deliverTx failed: %s", detxresp.Data))
t.Fatalf("deliverTx failed: %s", detxresp.Data)
}
} else {
if !expectedResult {
Expand Down
5 changes: 2 additions & 3 deletions vochain/proof_minime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package vochain
import (
"context"
"encoding/json"
"fmt"
"testing"

cometabcitypes "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -137,7 +136,7 @@ func testMinimeSendVotes(t *testing.T, s ethstorageproof.StorageProof, addr comm
cktxresp, _ = app.CheckTx(context.Background(), cktx)
if cktxresp.Code != 0 {
if expectedResult {
t.Fatalf(fmt.Sprintf("checkTx failed: %s", cktxresp.Data))
t.Fatalf("checkTx failed: %s", cktxresp.Data)
}
} else {
if !expectedResult {
Expand All @@ -151,7 +150,7 @@ func testMinimeSendVotes(t *testing.T, s ethstorageproof.StorageProof, addr comm
detxresp := app.deliverTx(txb)
if detxresp.Code != 0 {
if expectedResult {
t.Fatalf(fmt.Sprintf("deliverTx failed: %s", detxresp.Data))
t.Fatalf("deliverTx failed: %s", detxresp.Data)
}
} else {
if !expectedResult {
Expand Down
5 changes: 2 additions & 3 deletions vochain/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package vochain

import (
"context"
"fmt"
"testing"

cometabcitypes "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -225,7 +224,7 @@ func testCSPsendVotes(t *testing.T, pid []byte, vp []byte, signer *ethereum.Sign
cktxresp, _ = app.CheckTx(context.Background(), cktx)
if cktxresp.Code != 0 {
if expectedResult {
t.Fatalf(fmt.Sprintf("checkTx failed: %s", cktxresp.Data))
t.Fatalf("checkTx failed: %s", cktxresp.Data)
}
} else {
if !expectedResult {
Expand All @@ -237,7 +236,7 @@ func testCSPsendVotes(t *testing.T, pid []byte, vp []byte, signer *ethereum.Sign
detxresp := app.deliverTx(txb)
if detxresp.Code != 0 {
if expectedResult {
t.Fatalf(fmt.Sprintf("deliverTx failed: %s", detxresp.Data))
t.Fatalf("deliverTx failed: %s", detxresp.Data)
}
} else {
if !expectedResult {
Expand Down

0 comments on commit 2472f4a

Please sign in to comment.