Skip to content

ERRO Running error: buildir: analysis skipped: errors in package #1190

@akarl

Description

@akarl

Thank you for creating the issue!

  • 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).

Please include the following information:

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.27.0 built from fb74c2e on 2020-05-13T18:48:26Z
Config file
$ cat .golangci.yml
cat: .golangci.yml: No such file or directory
Go environment
$ go version && go env
go version go1.14.4 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/username/.cache/go-build"
GOENV="/home/username/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY="work.domain/*"
GONOSUMDB="work.domain/*"
GOOS="linux"
GOPATH="/home/username/go"
GOPRIVATE="work.domain/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/username/workspace/project/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-build477740903=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/username/workspace/project /home/username/workspace /home/username /home /] 
INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck] 
INFO [loader] Go packages loading at mode 575 (types_sizes|deps|imports|files|name|compiled_files|exports_file) took 366.215094ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 5.737105ms 
INFO [linters context/goanalysis] analyzers took 19.138544687s with top 10 stages: buildir: 16.259049518s, inspect: 817.31308ms, ctrlflow: 615.274302ms, printf: 481.902916ms, fact_deprecated: 457.945407ms, fact_purity: 376.953927ms, deadcode: 22.307961ms, ineffassign: 17.454063ms, SA9003: 7.568652ms, SA1027: 7.150707ms 
WARN [runner] Can't run linter goanalysis_metalinter: S1038: failed prerequisites: [([email protected]/reg/project/pkg/mail [work.domain/reg/project/pkg/mail.test], [email protected]/reg/project/pkg/mail [work.domain/reg/project/pkg/mail.test]): analysis skipped: errors in package: [/home/username/workspace/project/pkg/mail/mail_test.go:31:21: SetupDB not declared by package servicetest]] 
INFO [linters context/goanalysis] analyzers took 278.035992ms with top 10 stages: buildir: 246.749649ms, U1000: 31.286343ms 
WARN [runner] Can't run linter unused: buildir: analysis skipped: errors in package: [/home/username/workspace/project/pkg/mail/mail_test.go:31:21: SetupDB not declared by package servicetest] 
INFO [runner] processing took 3.524µs with stages: max_same_issues: 901ns, nolint: 332ns, skip_dirs: 318ns, max_from_linter: 287ns, cgo: 200ns, filename_unadjuster: 161ns, source_code: 159ns, path_prettifier: 154ns, path_shortener: 152ns, skip_files: 151ns, diff: 150ns, autogenerated_exclude: 150ns, identifier_marker: 144ns, uniq_by_line: 69ns, exclude: 66ns, exclude-rules: 65ns, max_per_file_from_linter: 65ns 
INFO [runner] linters took 9.185514991s with stages: goanalysis_metalinter: 8.591281736s, unused: 594.182824ms 
ERRO Running error: buildir: analysis skipped: errors in package: [/home/username/workspace/project/pkg/mail/mail_test.go:31:21: SetupDB not declared by package servicetest] 
INFO Memory: 97 samples, avg is 271.4MB, max is 474.1MB 
INFO Execution took 9.564607396s   

I have an error, the SetupDB function doesn't exist any more. And when I run golangci-lint run I get the following output:

WARN [runner] Can't run linter goanalysis_metalinter: S1033: failed prerequisites: [([email protected]/reg/project/pkg/mail [work.domain/reg/project/pkg/mail.test], [email protected]/reg/project/pkg/mail [work.domain/reg/project/pkg/mail.test]): analysis skipped: errors in package: [/home/username/workspace/project/pkg/mail/mail_test.go:31:21: SetupDB not declared by package servicetest]] 
WARN [runner] Can't run linter unused: buildir: analysis skipped: errors in package: [/home/username/workspace/project/pkg/mail/mail_test.go:31:21: SetupDB not declared by package servicetest] 
ERRO Running error: buildir: analysis skipped: errors in package: [/home/username/workspace/project/pkg/mail/mail_test.go:31:21: SetupDB not declared by package servicetest] 

If I disable everything and just run the typecheck linter I get a much better output:

$  golangci-lint run --disable-all -E typecheck
pkg/mail/mail_test.go:31:21: SetupDB not declared by package servicetest (typecheck)
	dsn := servicetest.SetupDB(t)
	                   ^

Is you can see, I get around the issue in my VIM config by first running only typecheck and if that doesn't give me any errors, then I can run the other linters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions