profile
viewpoint

Ask questionsgolint errors are not reported

Running golint reveals a lot of failures (mostly exported type comment errors) with the following: golint -set_exit_status=1 $(go list ./...)

running it with golangci-lint (with enabled golint) does not return the above errors: golangci-lint -v -e golint run --build-tags integration

I suspect that golint runs not with the above arguments, namely $(go list ./...)...

  1. Version: master v1.13.2
  2. No config file
  3. env: go version go1.12 linux/amd64 GOARCH="amd64" GOBIN="" GOCACHE="/home/mantzas/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/mantzas/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/mantzas/src/beat/rems/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-build031817835=/tmp/go-build -gno-record-gcc-switches"
  4. golangci-lint -v -e golint run --build-tags integration
    INFO [config_reader] Config search paths: [./ /home/mantzas/src/beat/rems /home/mantzas/src/beat /home/mantzas/src /home/mantzas /home /] INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck] INFO [lintersdb] Optimized sublinters [staticcheck gosimple unused] into metalinter megacheck INFO [loader] Go packages loading at mode load deps types and syntax took 1.160186581s INFO [loader] SSA repr building timing: packages building 18.7906ms, total 210.107868ms INFO [runner] worker.1 took 9.99µs INFO [runner] worker.11 took 9.02µs INFO [runner] worker.13 took 5.25µs INFO [runner] worker.7 took 6.93µs INFO [runner] worker.5 took 1.44µs INFO [runner] worker.8 took 2.73µs INFO [runner] worker.6 took 1.06µs INFO [runner] worker.9 took 1.95µs INFO [runner] worker.3 took 5.45µs INFO [runner] worker.15 took 1.779222ms with stages: errcheck: 1.747192ms, typecheck: 17.43µs INFO [runner] worker.12 took 2.466463ms with stages: structcheck: 2.463293ms INFO [runner] worker.2 took 6.275146ms with stages: deadcode: 6.258036ms INFO [runner] worker.16 took 8.317158ms with stages: varcheck: 8.302598ms INFO [runner] worker.14 took 18.24481ms with stages: ineffassign: 18.23119ms INFO [runner] worker.10 took 30.837393ms with stages: govet: 30.818683ms INFO [runner] worker.4 took 832.582598ms with stages: megacheck: 832.570058ms INFO [runner] Workers idle times: #1: 832.430548ms, #2: 826.265132ms, #3: 831.885437ms, #5: 832.350908ms, #6: 832.299468ms, #7: 832.387998ms, #8: 832.309528ms, #9: 832.248698ms, #10: 801.741855ms, #11: 832.422038ms, #12: 830.075165ms, #13: 832.395288ms, #14: 814.325658ms, #15: 830.752466ms, #16: 824.23668ms INFO [runner] Issues before processing: 3, after processing: 0 INFO [runner] processing took 828.071µs with stages: exclude: 376.78µs, skip_dirs: 186.521µs, path_prettifier: 166.45µs, autogenerated_exclude: 69.3µs, cgo: 22.96µs, max_same_issues: 1.29µs, diff: 970ns, nolint: 670ns, skip_files: 670ns, max_from_linter: 570ns, source_code: 570ns, uniq_by_line: 500ns, max_per_file_from_linter: 420ns, path_shortener: 400ns INFO Memory: 23 samples, avg is 383.7MB, max is 746.6MB INFO Execution took 2.252028059s
golangci/golangci-lint

Answer questions steveazz

I was experiencing the same issue, but when I updated to v1.18.0 it fixed the problem for me. @mantzas @alexcpn can you see if updating to the latest version fixes it for you?

Related questions

confusing error message "File is not goimports-ed (goimports)" hot 94
Build errors using Go 1.13 hot 30
BUG: failed run hot 19
please surpport ignore someOne fuction's igored error hot 12
ERRO Running error: context loading failed: failed to load program with go/packages hot 12
golangci-lint "DecodeRune not declared by package utf8" with golang 1.13 hot 11
Setting GO111MODULE=on for golangci.com hot 10
go get cmd/golangci-lint fails on Go 1.13 (tip) which uses proxy.golang.org (HTTP error 410 Gone) hot 10
Golangci-lint Incompatibility with newer versions of Go? hot 9
golangci-lint "DecodeRune not declared by package utf8" with golang 1.13 hot 9
Cannot `go get` due to invalid pseudo-version hot 8
concurrent map access on 1.17.1 hot 8
VS Code can't find .golangci.yml hot 8
panic on bodyclose hot 7
[Feature] TODO/FIXME linter hot 7
Github User Rank List