Skip to content

staticcheck doesn't work in v1.47.2 #3026

@sukki37

Description

@sukki37

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

staticcheck seems doesn’t work. With the same code and configuration, using staticcheck command directly would report many errors, but using golangci-lint there seems everything is ok.

Version of golangci-lint

$ golangci-lint --version
# Paste output here

Configuration file

$ cat .golangci.yml
# paste output here
v1.47.2

Go environment

$ go version && go env
# paste output here
go version go1.18 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/opt/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/opt/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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-build1617367600=/tmp/go-build -gno-record-gcc-switches"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here
golangci-lint run -v -c .golangci-lint.yml ./...
INFO [config_reader] Used config file .golangci-lint.yml 
INFO [lintersdb] Active 15 linters: [deadcode depguard errcheck exportloopref gofmt gosimple govet ineffassign prealloc rowserrcheck staticcheck structcheck typecheck unused varcheck] 
INFO [loader] Go packages loading at mode 575 (name|types_sizes|compiled_files|deps|exports_file|files|imports) took 42.402616908s 
INFO [runner/filename_unadjuster] Pre-built 2 adjustments in 123.558001ms 
INFO [linters context/goanalysis] analyzers took 2m52.987225587s with top 10 stages: buildir: 56.87517251s, gofmt: 6.060680897s, S1038: 4.752459806s, unused: 4.190751314s, inspect: 3.451040317s, directives: 2.554453153s, S1039: 1.927667183s, printf: 1.888487294s, SA1012: 1.658661914s, varcheck: 1.609130118s 
WARN [linters context] rowserrcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. 
WARN [linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. 
INFO [runner/skip dirs] Skipped 5 issues from dir pkg/sql/plan/function/builtin/multi by pattern (^|/)builtin($|/) 
INFO [runner/skip dirs] Skipped 6 issues from dir pkg/sql/plan/function/builtin/unary by pattern (^|/)builtin($|/) 
INFO [runner/skip dirs] Skipped 2 issues from dir pkg/sql/plan/function/builtin/binary by pattern (^|/)builtin($|/) 
INFO [runner/skip dirs] Skipped 2 issues from dir pkg/common/morpc/examples/message by pattern (^|/)examples($|/) 
INFO [runner] Issues before processing: 945, after processing: 0 
INFO [runner] Processors filtering stat (out/in): skip_files: 797/797, identifier_marker: 289/289, filename_unadjuster: 797/797, autogenerated_exclude: 289/782, cgo: 797/945, exclude-rules: 0/289, path_prettifier: 797/797, skip_dirs: 782/797, exclude: 289/289 
INFO [runner] processing took 6.870061ms with stages: identifier_marker: 3.172762ms, autogenerated_exclude: 1.523984ms, path_prettifier: 1.063913ms, skip_dirs: 525.354µs, exclude-rules: 497.362µs, cgo: 46.968µs, filename_unadjuster: 28.483µs, max_per_file_from_linter: 3.206µs, max_from_linter: 3.046µs, nolint: 1.212µs, max_same_issues: 983ns, uniq_by_line: 490ns, source_code: 430ns, skip_files: 360ns, exclude: 300ns, path_shortener: 290ns, sort_results: 290ns, severity-rules: 259ns, diff: 250ns, path_prefixer: 119ns 
INFO [runner] linters took 13.30072062s with stages: goanalysis_metalinter: 13.293687318s, rowserrcheck: 15.338µs, structcheck: 11.902µs 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 552 samples, avg is 364.2MB, max is 1913.3MB 
INFO Execution took 55.835466979s                 

Code example or link to a public repository

// add your code here
https://github.com/sukki37/matrixone/tree/sukki37-patch-1
make install-static-check-tools
make static-check

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions