build: Add unconvert linter to goclean.sh

This commit is contained in:
David Hill 2016-12-01 18:01:55 -05:00
parent 1425c4327e
commit 2d8020d311
3 changed files with 7 additions and 4 deletions

View file

@ -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),
}

View file

@ -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

View file

@ -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 ./...