From 2d8020d311cd22f706463982d8b8cb5ffeda2f64 Mon Sep 17 00:00:00 2001 From: David Hill Date: Thu, 1 Dec 2016 18:01:55 -0500 Subject: [PATCH] build: Add unconvert linter to goclean.sh --- bloom/merkleblock.go | 2 +- bloom/murmurhash3.go | 2 +- goclean.sh | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bloom/merkleblock.go b/bloom/merkleblock.go index 37ed9f9..d6796ba 100644 --- a/bloom/merkleblock.go +++ b/bloom/merkleblock.go @@ -111,7 +111,7 @@ func NewMerkleBlock(block *btcutil.Block, filter *Filter) (*wire.MsgMerkleBlock, // Create and return the merkle block. msgMerkleBlock := wire.MsgMerkleBlock{ Header: block.MsgBlock().Header, - Transactions: uint32(mBlock.numTx), + Transactions: mBlock.numTx, Hashes: make([]*chainhash.Hash, 0, len(mBlock.finalHashes)), Flags: make([]byte, (len(mBlock.bits)+7)/8), } diff --git a/bloom/murmurhash3.go b/bloom/murmurhash3.go index cc7f98f..6bb562e 100644 --- a/bloom/murmurhash3.go +++ b/bloom/murmurhash3.go @@ -61,7 +61,7 @@ func MurmurHash3(seed uint32, data []byte) uint32 { } // Finalization. - hash ^= uint32(dataLen) + hash ^= dataLen hash ^= hash >> 16 hash *= 0x85ebca6b hash ^= hash >> 13 diff --git a/goclean.sh b/goclean.sh index 8e820a8..403e104 100755 --- a/goclean.sh +++ b/goclean.sh @@ -4,12 +4,14 @@ # 2. goimports (https://github.com/bradfitz/goimports) # 3. golint (https://github.com/golang/lint) # 4. go vet (http://golang.org/cmd/vet) -# 5. test coverage (http://blog.golang.org/cover) +# 5. unconvert (https://github.com/mdempsky/unconvert) +# 6. race detector (http://blog.golang.org/race-detector) +# 7. test coverage (http://blog.golang.org/cover) # # gometalint (github.com/alecthomas/gometalinter) is used to run each each # static checker. -set -e +set -ex # Automatic checks test -z "$(gometalinter --disable-all \ @@ -17,6 +19,7 @@ test -z "$(gometalinter --disable-all \ --enable=goimports \ --enable=golint \ --enable=vet \ +--enable=unconvert \ --deadline=120s ./... | grep -v 'ExampleNew' 2>&1 | tee /dev/stderr)" env GORACE="halt_on_error=1" go test -v -race ./...