-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Welcome
- 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 read the typecheck section of the FAQ (https://golangci-lint.run/usage/faq/#why-do-you-have-typecheck-errors).
- Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)
Description of the problem
I searched for similar issues, but it is pretty subtle so I can't tell for sure. Feel free to close as duplicate.
To reproduce, create a new folder 'testgolint', with a 'src' folder and two files: go.main and go.mod:
➜ testgolint ls -R
src
./src:
go.mod main.go
Run the linter:
➜ testgolint golangci-lint run src/...
ERRO [linters_context] typechecking error: pattern ./src/...: directory prefix src does not contain main module or its selected dependencies
➜ testgolint golangci-lint run src
ERRO Running error: context loading failed: no go files to analyze
env:
➜ testgolint go env GOPATH
/Users/xyz/go
➜ testgolint go version
go version go1.20.4 darwin/arm64
Version of golangci-lint
$ golangci-lint --version
➜ testgolint golangci-lint --version
golangci-lint has version 1.55.2 built with go1.21.3 from e3c2265f on 2023-11-03T12:59:25Z
Configuration
# paste configuration file or CLI flags here
n/a
Go environment
see description, don't want to paste all info unless it is really needed
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /Users/stephan.westen/projects/testgolint /Users/stephan.westen/projects /Users/stephan.westen /Users /]
INFO [lintersdb] Active 6 linters: [errcheck gosimple govet ineffassign staticcheck unused]
INFO [loader] Go packages loading at mode 575 (imports|name|compiled_files|deps|exports_file|files|types_sizes) took 17.879708ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 24.125µs
ERRO [linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies
INFO [linters_context/goanalysis] analyzers took 2.299212ms with top 10 stages: fact_deprecated: 511.167µs, buildir: 408.584µs, typecheck: 113.875µs, ineffassign: 103.208µs, httpresponse: 87.834µs, S1003: 80.333µs, framepointer: 71.917µs, S1016: 71.458µs, unmarshal: 65.834µs, SA4000: 62.584µs
INFO [runner] processing took 1.288µs with stages: max_same_issues: 208ns, skip_files: 166ns, skip_dirs: 166ns, path_prettifier: 83ns, nolint: 83ns, path_prefixer: 42ns, filename_unadjuster: 42ns, fixer: 42ns, sort_results: 42ns, severity-rules: 42ns, diff: 42ns, cgo: 42ns, exclude-rules: 42ns, uniq_by_line: 41ns, max_per_file_from_linter: 41ns, max_from_linter: 41ns, autogenerated_exclude: 41ns, identifier_marker: 41ns, source_code: 41ns, exclude: 0s, path_shortener: 0s
INFO [runner] linters took 12.61375ms with stages: goanalysis_metalinter: 12.575917ms
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 2 samples, avg is 27.4MB, max is 27.7MB
INFO Execution took 43.000541ms
A minimal reproducible example or link to a public repository
see describes
Validation
- Yes, I've included all information above (version, config, etc.).
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested