8000 chore: enable gomoddirectives, unparam by faddat · Pull Request #2290 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: enable gomoddirectives, unparam #2290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @ 10000 @ -26,7 +26,6 @@ linters:
- goerr113
- golint
- gomnd
- gomoddirectives
- ifshort
- interfacebloat
- interfacer
Expand All @@ -46,9 +45,6 @@ linters:
- structcheck
- tagliatelle
- testifylint
- typecheck
# Prefer unparam over revive's unused param. It is more thorough in its checking.
- unparam
- varcheck
- varnamelen
- wrapcheck
Expand Down
5 changes: 4 additions & 1 deletion internal/bits/bit_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,10 @@ func (bA *BitArray) UnmarshalJSON(bz []byte) error {
bA2.SetIndex(i, true)
}
}
*bA = *bA2 //nolint:govet
// Instead of *bA = *bA2
bA.Bits = bA2.Bits
bA.Elems = make([]uint64, len(bA2.Elems))
copy(bA.Elems, bA2.Elems)
return nil
}

Expand Down
14 changes: 7 additions & 7 deletions light/store/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (s *dbs) LastLightBlockHeight() (int64, error) {

for itr.Valid() {
key := itr.Key()
_, height, ok := parseLbKey(key)
height, ok := parseLbKey(key)
if ok {
return height, nil
}
Expand All @@ -171,7 +171,7 @@ func (s *dbs) FirstLightBlockHeight() (int64, error) {

for itr.Valid() {
key := itr.Key()
_, height, ok := parseLbKey(key)
height, ok := parseLbKey(key)
if ok {
return height, nil
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func (s *dbs) LightBlockBefore(height int64) (*types.LightBlock, error) {

for itr.Valid() {
key := itr.Key()
_, existingHeight, ok := parseLbKey(key)
existingHeight, ok := parseLbKey(key)
if ok {
return s.LightBlock(existingHeight)
}
Expand Down Expand Up @@ -245,7 +245,7 @@ func (s *dbs) Prune(size uint16) error {
pruned := 0
for itr.Valid() && numToPrune > 0 {
key := itr.Key()
_, height, ok := parseLbKey(key)
height, ok := parseLbKey(key)
if ok {
if err = b.Delete(s.lbKey(height)); err != nil {
return err
Expand Down Expand Up @@ -307,11 +307,11 @@ func parseKey(key []byte) (part string, prefix string, height int64, ok bool) {
return
}

func parseLbKey(key []byte) (prefix string, height int64, ok bool) {
func parseLbKey(key []byte) (height int64, ok bool) {
var part string
part, prefix, height, ok = parseKey(key)
part, _, height, ok = parseKey(key)
if part != "lb" {
return "", 0, false
return 0, false
}
return
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/pkg/infra/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func ansiblePerturbConnectionBytes(disconnect bool) string {
}

// ExecCompose runs a Docker Compose command for a testnet.
func execAnsible(ctx context.Context, dir, playbook string, nodeIPs []string, args ...string) error {
func execAnsible(ctx context.Context, dir, playbook string, nodeIPs []string, args ...string) error { //nolint:unparam
playbook = filepath.Join(dir, playbook)
return exec.CommandVerbose(ctx, append(
[]string{"ansible-playbook", playbook, "-f", "50", "-u", "root", "--inventory", strings.Join(nodeIPs, ",") + ","},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tests/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func testNode(t *testing.T, testFunc func(*testing.T, e2e.Node)) {
//
// If maxNodes is set to 0 or below, all full nodes and validators will be
// tested.
func testFullNodesOrValidators(t *testing.T, maxNodes int, testFunc func(*testing.T, e2e.Node)) {
func testFullNodesOrValidators(t *testing.T, maxNodes int, testFunc func(*testing.T, e2e.Node)) { //nolint:unparam // maxNodes could be used in future tests
t.Helper()

testnet := loadTestnet(t)
Expand Down
0