From d307d5ade02e2fb4366fb41cab749a64d213dc45 Mon Sep 17 00:00:00 2001 From: "Y.Horie" Date: Fri, 2 Aug 2019 17:01:16 +0900 Subject: [PATCH] Add golangci-lint to travis.yml #25 --- .travis.yml | 4 ++++ fuzz.go | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8684d9..8653b4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,12 @@ go: - 1.2 - tip +before_install: + - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1 + install: - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi script: - go test -cover + - golangci-lint run --tests=false diff --git a/fuzz.go b/fuzz.go index 1dfa80a..5319565 100644 --- a/fuzz.go +++ b/fuzz.go @@ -446,10 +446,7 @@ var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){ // randBool returns true or false randomly. func randBool(r *rand.Rand) bool { - if r.Int()&1 == 1 { - return true - } - return false + return r.Int()&1 == 1 } type charRange struct {