Replace vet with golangci lint govet (#4277)

Drop go vet in favor of golangci-lint govet check.

Fix golangci-lint warnings.

Upgrade golangci-lint.
This commit is contained in:
Alessio Treglia 2019-05-06 17:50:05 +01:00 committed by GitHub
parent 5060187d3d
commit 06f7b2198a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 21 additions and 20 deletions

View File

@ -6,6 +6,7 @@ linters:
- ineffassign
- unconvert
- misspell
- govet
linters-settings:
gocyclo:
min-complexity: 11
@ -13,5 +14,8 @@ linters-settings:
ignore: fmt:.*,io/ioutil:^Read.*,github.com/spf13/cobra:MarkFlagRequired,github.com/spf13/viper:BindPFlag
golint:
min-confidence: 1.1
issues:
exclude:
- composite
run:
tests: false

View File

@ -209,7 +209,6 @@ test_cover:
lint: tools ci-lint
ci-lint:
golangci-lint run
go vet -composites=false -tests=false ./...
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
go mod verify

View File

@ -91,11 +91,6 @@ func NodeSyncingRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
}
syncing := status.SyncInfo.CatchingUp
if err != nil {
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
return
}
if _, err := w.Write([]byte(strconv.FormatBool(syncing))); err != nil {
log.Printf("could not write response: %v", err)
}

View File

@ -129,7 +129,6 @@ check-all: check-unit check-race check-cover check-build
lint: ci-lint
ci-lint:
golangci-lint run
go vet -composites=false -tests=false ./...
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
go mod verify

View File

@ -16,7 +16,7 @@ import (
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/cosmos/cosmos-sdk/client"
clientkeys "github.com/cosmos/cosmos-sdk/client/keys"

View File

@ -17,7 +17,7 @@ endif
GOPATH ?= $(shell $(GO) env GOPATH)
GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com
GOLANGCI_LINT_VERSION := v1.15.0
GOLANGCI_LINT_VERSION := v1.16.0
GOLANGCI_LINT_HASHSUM := ac897cadc180bf0c1a4bf27776c410debad27205b22856b861d41d39d06509cf
###

View File

@ -4,13 +4,15 @@ package crypto
import (
"fmt"
"github.com/btcsuite/btcd/btcec"
"github.com/pkg/errors"
bip39 "github.com/cosmos/go-bip39"
"github.com/cosmos/cosmos-sdk/crypto/keys/hd"
"github.com/cosmos/cosmos-sdk/tests"
"github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/go-bip39"
secp256k1 "github.com/tendermint/btcd/btcec"
"github.com/tendermint/tendermint/crypto"

View File

@ -4,9 +4,10 @@ import (
"bytes"
"encoding/hex"
"fmt"
"github.com/tendermint/tendermint/crypto/ed25519"
"time"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/multisig"
"github.com/tendermint/tendermint/crypto/secp256k1"

View File

@ -312,8 +312,8 @@ func (sup SoftwareUpgradeProposal) String() string {
}
var validProposalTypes = map[string]struct{}{
ProposalTypeText: struct{}{},
ProposalTypeSoftwareUpgrade: struct{}{},
ProposalTypeText: {},
ProposalTypeSoftwareUpgrade: {},
}
// RegisterProposalType registers a proposal type. It will panic if the type is

View File

@ -1,11 +1,12 @@
package client
import (
"github.com/spf13/cobra"
amino "github.com/tendermint/go-amino"
sdkclient "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/mint/client/cli"
"github.com/spf13/cobra"
"github.com/tendermint/go-amino"
)
type ModuleClient struct {

View File

@ -59,7 +59,7 @@ var paramChangePool = []simParamChange{
"MinSignedPerWindow",
"",
func(r *rand.Rand) string {
return fmt.Sprintf("\"%d\"", simulation.ModuleParamSimulator["MinSignedPerWindow"](r).(sdk.Dec))
return fmt.Sprintf("\"%s\"", simulation.ModuleParamSimulator["MinSignedPerWindow"](r).(sdk.Dec))
},
},
{
@ -67,7 +67,7 @@ var paramChangePool = []simParamChange{
"SlashFractionDowntime",
"",
func(r *rand.Rand) string {
return fmt.Sprintf("\"%d\"", simulation.ModuleParamSimulator["SlashFractionDowntime"](r).(sdk.Dec))
return fmt.Sprintf("\"%s\"", simulation.ModuleParamSimulator["SlashFractionDowntime"](r).(sdk.Dec))
},
},
// minting parameters
@ -76,7 +76,7 @@ var paramChangePool = []simParamChange{
"InflationRateChange",
"",
func(r *rand.Rand) string {
return fmt.Sprintf("\"%d\"", simulation.ModuleParamSimulator["InflationRateChange"](r).(sdk.Dec))
return fmt.Sprintf("\"%s\"", simulation.ModuleParamSimulator["InflationRateChange"](r).(sdk.Dec))
},
},
// auth parameters

View File

@ -55,8 +55,8 @@ func (p Params) String() string {
SignedBlocksWindow: %d
MinSignedPerWindow: %s
DowntimeJailDuration: %s
SlashFractionDoubleSign: %d
SlashFractionDowntime: %d`, p.MaxEvidenceAge,
SlashFractionDoubleSign: %s
SlashFractionDowntime: %s`, p.MaxEvidenceAge,
p.SignedBlocksWindow, p.MinSignedPerWindow,
p.DowntimeJailDuration, p.SlashFractionDoubleSign,
p.SlashFractionDowntime)