From 777ff271cba868b3abe4188ebab4c8bb711e7640 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 10 Sep 2019 21:58:17 +0400 Subject: [PATCH] enable unconvert, goconst and nakedret linters (#3973) This should've been a part of https://github.com/tendermint/tendermint/pull/3960, but I forgot about it while reviewing. A good programmer is someone who always looks both ways before crossing a one-way street. - Doug Linder --- .golangci.yml | 6 ------ types/vote_set.go | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 17d575316..690cc3f69 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,10 +9,7 @@ linters: - maligned - errcheck - interfacer - - unconvert - - goconst - unparam - - nakedret - lll - gochecknoglobals - gochecknoinits @@ -29,9 +26,6 @@ linters: # suggest-new: true # dupl: # threshold: 100 -# goconst: -# min-len: 2 -# min-occurrences: 2 # depguard: # list-type: blacklist # packages: diff --git a/types/vote_set.go b/types/vote_set.go index a4a42bb4c..56dd9a13c 100644 --- a/types/vote_set.go +++ b/types/vote_set.go @@ -434,7 +434,7 @@ func (voteSet *VoteSet) StringIndented(indent string) string { voteStrings := make([]string, len(voteSet.votes)) for i, vote := range voteSet.votes { if vote == nil { - voteStrings[i] = "nil-Vote" + voteStrings[i] = nilVoteStr } else { voteStrings[i] = vote.String() } @@ -499,7 +499,7 @@ func (voteSet *VoteSet) voteStrings() []string { voteStrings := make([]string, len(voteSet.votes)) for i, vote := range voteSet.votes { if vote == nil { - voteStrings[i] = "nil-Vote" + voteStrings[i] = nilVoteStr } else { voteStrings[i] = vote.String() }