-
Welcome
Description of the problemUsing golangci-lint both with and without the --tests switch scans *test.go files regardless. The help file says...
Suggests that if --tests is present then *_test.go files are scanned. But the default is true, so what is supposed to happen if it's omitted if the default is true? Version of golangci-lint$ golangci-lint --version
golangci-lint has version 1.41.1 built from a2074809 on 2021-06-19T16:01:50Z Configuration fileNone Go environment$ go version && go env
go version go1.16.3 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/REDACTED/go/bin"
GOCACHE="/home/REDACTED/.cache/go-build"
GOENV="/home/REDACTED/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/REDACTED/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/REDACTED/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.16"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.16/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/REDACTED/source/REDACTED/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3891235750=/tmp/go-build -gno-record-gcc-switches" Verbose output of runningNone Code example or link to a public repositoryNone |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, First, I recommend not using flags. The default is If you want to disable that you have to use |
Beta Was this translation helpful? Give feedback.
Hello,
First, I recommend not using flags.
The default is
true
so if you omit the flag or if you are using--test
or if you are using--test true
, the test files are checked.If you want to disable that you have to use
--test false