Skip to content

Commit

Permalink
Merge pull request #92 from jmhbnz/main
Browse files Browse the repository at this point in the history
Bump versions for golang, golangci-lint and protoc
  • Loading branch information
ahrtr authored Aug 5, 2023
2 parents e87bcc2 + 40c2e76 commit 89c97ed
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/govuln.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.19.11"
go-version: "1.19.12"
- run: date
- run: go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./...
6 changes: 3 additions & 3 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.19.11"
go-version: "1.19.12"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.49.0
version: v1.53.3
- name: protoc
uses: arduino/setup-protoc@v1
with:
version: '3.14.0'
version: '3.20.3'
- run: make verify
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.19.11"
go-version: "1.19.12"
- env:
TARGET: ${{ matrix.target }}
run: |
Expand Down
8 changes: 4 additions & 4 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
pb "go.etcd.io/raft/v3/raftpb"
)

func applyToStore(ents []pb.Entry) {}
func sendMessages(msgs []pb.Message) {}
func saveStateToDisk(st pb.HardState) {}
func saveToDisk(ents []pb.Entry) {}
func applyToStore(_ []pb.Entry) {}
func sendMessages(_ []pb.Message) {}
func saveStateToDisk(_ pb.HardState) {}
func saveToDisk(_ []pb.Entry) {}

func ExampleNode() {
c := &Config{}
Expand Down
2 changes: 1 addition & 1 deletion node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ type ignoreSizeHintMemStorage struct {
*MemoryStorage
}

func (s *ignoreSizeHintMemStorage) Entries(lo, hi uint64, maxSize uint64) ([]raftpb.Entry, error) {
func (s *ignoreSizeHintMemStorage) Entries(lo, hi uint64, _ uint64) ([]raftpb.Entry, error) {
return s.MemoryStorage.Entries(lo, hi, math.MaxUint64)
}

Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (env *InteractionEnv) Handle(t *testing.T, d datadriven.TestData) string {
// Example:
//
// log-level WARN
err = env.handleLogLevel(t, d)
err = env.handleLogLevel(d)
case "raft-log":
// Print the Raft log.
//
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_campaign.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (

func (env *InteractionEnv) handleCampaign(t *testing.T, d datadriven.TestData) error {
idx := firstAsNodeIdx(t, d)
return env.Campaign(t, idx)
return env.Campaign(idx)
}

// Campaign the node at the given index.
func (env *InteractionEnv) Campaign(t *testing.T, idx int) error {
func (env *InteractionEnv) Campaign(idx int) error {
return env.Nodes[idx].Campaign()
}
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_forget_leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (

func (env *InteractionEnv) handleForgetLeader(t *testing.T, d datadriven.TestData) error {
idx := firstAsNodeIdx(t, d)
env.ForgetLeader(t, idx)
env.ForgetLeader(idx)
return nil
}

// ForgetLeader makes the follower at the given index forget its leader.
func (env *InteractionEnv) ForgetLeader(t *testing.T, idx int) {
func (env *InteractionEnv) ForgetLeader(idx int) {
env.Nodes[idx].ForgetLeader()
}
3 changes: 1 addition & 2 deletions rafttest/interaction_env_handler_log_level.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ package rafttest
import (
"fmt"
"strings"
"testing"

"github.com/cockroachdb/datadriven"
)

func (env *InteractionEnv) handleLogLevel(t *testing.T, d datadriven.TestData) error {
func (env *InteractionEnv) handleLogLevel(d datadriven.TestData) error {
return env.LogLevel(d.CmdArgs[0].Key)
}

Expand Down
2 changes: 1 addition & 1 deletion rawnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type rawNodeAdapter struct {
var _ Node = (*rawNodeAdapter)(nil)

// TransferLeadership is to test when node specifies lead, which is pointless, can just be filled in.
func (a *rawNodeAdapter) TransferLeadership(ctx context.Context, lead, transferee uint64) {
func (a *rawNodeAdapter) TransferLeadership(_ context.Context, _, transferee uint64) {
a.RawNode.TransferLeader(transferee)
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/genproto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ fi

source ./scripts/test_lib.sh

if [[ $(protoc --version | cut -f2 -d' ') != "3.14.0" ]]; then
echo "could not find protoc 3.14.0, is it installed + in PATH?"
if [[ $(protoc --version | cut -f2 -d' ') != "3.20.3" ]]; then
echo "could not find protoc 3.20.3, is it installed + in PATH?"
exit 255
fi

Expand Down

0 comments on commit 89c97ed

Please sign in to comment.