Skip to content

multiple files gives the error: no go files to analyze #391

Closed
@gregwebs

Description

@gregwebs
../tools/bin/golangci-lint run dir/a.go dir/b.go
ERRO Running error: context loading failed: no go files to analyze

However, if I give it just a.go or b.go, it runs without issue.

Thank you for creating the issue!

Please include the following information:

  1. Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution)
    v1.14.0

  2. Config file: cat .golangci.yml
    So far I have made a few minor changes to the example file.

  3. Go environment: go version && go env

go version && go env
go version go1.11.5 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/gweber/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/gweber/go"
GOPROXY=""
GORACE=""
GOROOT="/home/gweber/lib/go"
GOTMPDIR=""
GOTOOLDIR="/home/gweber/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build316335654=/tmp/go-build -gno-record-gcc-switches"
  1. Verbose output of running: golangci-lint run -v
 ../tools/bin/golangci-lint run -v ./service/backup/service.go ./service/cluster/service.go
INFO [config_reader] Config search paths: [./ /home/gweber/go/src/github.com/pingcap/dbaas/operations/service/backup /home/gweber/go/src/github.com/pingcap/dbaas/operations/service /home/gweber/go/src/github.com/pingcap/dbaas/operations /home/gweber/go/src/github.com/pingcap/dbaas /home/gweber/go/src/github.com/pingcap /home/gweber/go/src/github.com /home/gweber/go/src /home/gweber/go /home/gweber /home /] 
INFO [config_reader] Used config file ../.golangci.yml 
INFO [lintersdb] Active 13 linters: [deadcode errcheck gosec gosimple govet ineffassign scopelint staticcheck structcheck typecheck unparam unused varcheck] 
INFO [lintersdb] Active presets: [bugs unused]    
INFO [lintersdb] Optimized sublinters [staticcheck gosimple unused] into metalinter megacheck 
INFO [loader] Go packages loading at mode load deps types and syntax took 29.943359ms 
ERRO Running error: context loading failed: no go files to analyze 
INFO Memory: 2 samples, avg is 69.2MB, max is 69.2MB 
INFO Execution took 142.363875ms            

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions