Skip to content

Docker version golangci/golangci-lint:v1.37.1 raise "no go files to analyze" #1784

Closed
@ybiquitous

Description

@ybiquitous
  • 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

The Docker version of golangci/golangci-lint:v1.37.1 raises the error Running error: context loading failed: no go files to analyze, while golangci/golangci-lint:v1.36.0 never raises any error.

See also #825 (comment).

Version of golangci-lint
$ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.37.1 golangci-lint version
golangci-lint has version v1.37.1 built from b39dbcd6 on 2021-02-20T11:59:15Z
Config file

No config file.

Go environment
$ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.37.1 go version
go version go1.16 linux/amd64

$ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.37.1 go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/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.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build2324239100=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.37.1 golangci-lint cache clean
$ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.37.1 golangci-lint run -v
level=info msg="[config_reader] Config search paths: [./ /app / /root]"
level=info msg="[lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]"
level=info msg="[loader] Go packages loading at mode 575 (types_sizes|exports_file|name|files|imports|compiled_files|deps) took 44.4827ms"
level=error msg="Running error: context loading failed: no go files to analyze"
level=info msg="Memory: 2 samples, avg is 72.1MB, max is 72.1MB"
level=info msg="Execution took 50.8686ms"
Code example or link to a public repository

test.go:

package main

var unused int

func main() {
	print()
}

Only test.go file is present in the current directory:

$ ls -a .
.       ..      test.go

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