From 6fcd0776966156fac6571e18ffcc00455f7aa3cd Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sat, 6 Jan 2018 19:20:12 -0600 Subject: [PATCH] stake: Override false positive vet error. This adds a directive to instruct gometalinter to ignore a false positive produced by vet. The code in question intentionally makes use of the property vet is warning about. --- blockchain/stake/internal/tickettreap/common.go | 4 +++- run_tests.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blockchain/stake/internal/tickettreap/common.go b/blockchain/stake/internal/tickettreap/common.go index ac77a6f6..3b25adc0 100644 --- a/blockchain/stake/internal/tickettreap/common.go +++ b/blockchain/stake/internal/tickettreap/common.go @@ -12,7 +12,9 @@ import ( ) const ( - // ptrSize is the number of bytes in a native pointer + // ptrSize is the number of bytes in a native pointer. + // + // nolint: vet ptrSize = 4 << (^uintptr(0) >> 63) // staticDepth is the size of the static array to use for keeping track diff --git a/run_tests.sh b/run_tests.sh index 7878d266..7a3c7ce1 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -40,7 +40,7 @@ testrepo () { --enable=vet \ --enable=gosimple \ --enable=unconvert \ - --enable=ineffassign ./... | tee /dev/stderr + --enable=ineffassign "$TESTDIRS" if [ $? != 0 ]; then echo 'gometalinter has some complaints' exit 1