Skip to content

Directory and path to go file can not specify as target at the same time in spite of the description in README #942

@mpls104

Description

@mpls104

Readme says that it is possible to specify directory and file path at the same time but it fails.

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
$ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.23.1 golangci-lint run --version
# golangci-lint has version 1.23.1 built from 567904e on 2020-01-20T08:00:15Z
Config file
no config file
Go environment
According to Docker image
Verbose output of running
$ docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.23.1 golangci-lint run dir1 dir2/... dir3/file1.go -v` 
level=info msg="[config_reader] Config search paths: [./ /app/dir1 /app /]"
level=info msg="[lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]"
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 (compiled_files|deps|exports_file|files|name|imports|types_sizes) took 25.5212ms"
level=error msg="Running error: context loading failed: failed to load program with go/packages: -: named files must be .go files: ./dir1"
level=info msg="Memory: 2 samples, avg is 69.2MB, max is 69.2MB"
level=info msg="Execution took 33.7025ms"

It seems that combination of directory and file causes problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleNo recent correspondence or work activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions