Skip to content
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

build: update golangci-lint to v1.44.1 #2882

Merged
merged 1 commit into from
Feb 18, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Check out source
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f #v2.3.4
- name: Install Linters
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.0"
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.44.1"
- name: Build
run: go build ./...
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion addrmgr/addrmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestStartStop(t *testing.T) {
wantNetAddrKey := net.JoinHostPort(someIP, "8333")
gotNetAddrKey := knownAddress.na.Key()
if gotNetAddrKey != wantNetAddrKey {
t.Fatal("address manager does not contain expected address - "+
t.Fatalf("address manager does not contain expected address - "+
"got %v, want %v", gotNetAddrKey, wantNetAddrKey)
}

Expand Down
2 changes: 1 addition & 1 deletion blockchain/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func newFakeCreateTSpend(privKey []byte, payouts []dcrutil.Amount, fee dcrutil.A
}
script := make([]byte, len(p2shOpTrueScript)+1)
script[0] = txscript.OP_TGEN
copy(script[1:], p2shOpTrueScript[:])
copy(script[1:], p2shOpTrueScript)
msgTx.AddTxOut(wire.NewTxOut(int64(amount), script))
}

Expand Down
2 changes: 1 addition & 1 deletion blockchain/internal/spendpruner/pruner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func TestSpendPruner(t *testing.T) {
hashB := &chainhash.Hash{'b'}
err = pruner.addSpendConsumerDeps(hashB)
if err != nil {
t.Fatal("unexpected error adding consumer dependencies "+
t.Fatalf("unexpected error adding consumer dependencies "+
"for hashB: %v", err)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/mempool/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ func TestOrphanReject(t *testing.T) {

// Ensure no transactions were reported as accepted.
if len(acceptedTxns) != 0 {
t.Fatal("ProcessTransaction: reported %d accepted "+
t.Fatalf("ProcessTransaction: reported %d accepted "+
"transactions from failed orphan attempt",
len(acceptedTxns))
}
Expand Down Expand Up @@ -2358,7 +2358,7 @@ func createTSpend(t *testing.T, expiry uint32, tspendAmount, tspendFee int64, pi
}
script := make([]byte, len(p2shOpTrueScript)+1)
script[0] = txscript.OP_TGEN
copy(script[1:], p2shOpTrueScript[:])
copy(script[1:], p2shOpTrueScript)
msgTx.AddTxOut(wire.NewTxOut(tspendAmount, script))

msgTx.AddTxIn(&wire.TxIn{
Expand Down
2 changes: 1 addition & 1 deletion internal/rpcserver/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5591,7 +5591,7 @@ func handleVerifyMessage(_ context.Context, s *Server, cmd interface{}) (interfa

// handleVersion implements the version command.
func handleVersion(_ context.Context, s *Server, cmd interface{}) (interface{}, error) {
runtimeVer := strings.Replace(runtime.Version(), ".", "-", -1)
runtimeVer := strings.ReplaceAll(runtime.Version(), ".", "-")
buildMeta := version.NormalizeString(runtimeVer)
build := version.NormalizeString(version.BuildMetadata)
if build != "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/rpcserver/rpcserverhandlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8542,7 +8542,7 @@ func TestHandleGetRawTransaction(t *testing.T) {
func TestHandleVersion(t *testing.T) {
t.Parallel()

runtimeVer := strings.Replace(runtime.Version(), ".", "-", -1)
runtimeVer := strings.ReplaceAll(runtime.Version(), ".", "-")
version.BuildMetadata = "foo"
version.PreRelease = "pre"
buildMeta := version.NormalizeString(fmt.Sprintf("%s.%s",
Expand Down
4 changes: 2 additions & 2 deletions internal/rpcserver/treasury_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ func TestTreasury(t *testing.T) {
t.Fatal(err)
}
assertTBaseAmount(t, hn.Node, tbaseSubsidy)
nbVotes = nbVotes + int64(4)
nbVotes += int64(4)
assertTSpendVoteCount(t, hn.Node, tspendNo, false, 0, nbVotes)
assertTSpendVoteCount(t, hn.Node, tspendLarge, false, nbVotes, 0)

Expand All @@ -639,7 +639,7 @@ func TestTreasury(t *testing.T) {
if _, err := vw.GenerateBlocks(timeoutCtx(t, time.Minute), 1); err != nil {
t.Fatal(err)
}
nbVotes = nbVotes + int64(3)
nbVotes += int64(3)
assertTBaseAmount(t, hn.Node, tbaseSubsidy)
assertTSpendVoteCount(t, hn.Node, tspendNo, false, 0, nbVotes)
assertTSpendVoteCount(t, hn.Node, tspendLarge, false, nbVotes, 0)
Expand Down
2 changes: 1 addition & 1 deletion rpctest/rpc_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func New(t *testing.T, activeNet *chaincfg.Params, handlers *rpcclient.Notificat
}

// Uncomment and change to enable additional dcrd debug/trace output.
//config.debugLevel = "TXMP=trace,TRSY=trace,RPCS=trace,PEER=trace"
// config.debugLevel = "TXMP=trace,TRSY=trace,RPCS=trace,PEER=trace"

// Generate p2p+rpc listening addresses.
config.listen, config.rpcListen = generateListeningAddresses()
Expand Down
2 changes: 1 addition & 1 deletion upnp.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func soapRequest(url, function, message string) (replyXML []byte, err error) {
"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n" +
"<s:Body>" + message + "</s:Body></s:Envelope>"

req, err := http.NewRequest("POST", url, strings.NewReader(fullMessage))
req, err := http.NewRequest(http.MethodPost, url, strings.NewReader(fullMessage))
if err != nil {
return nil, err
}
Expand Down