-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with gomoddirectives using Go 1.18 and multi-module setup #2752
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
Hello, I created a directory tree based on your log and your configuration, but I don't reproduce your problem.
$ go version
go version go1.18 linux/amd64 $ golangci-lint version
golangci-lint has version 1.45.2 built from 8bdc4d3f on 2022-03-24T11:51:26Z $ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/ldez/sources/experimental/golangci /home/ldez/sources/experimental /home/ldez/sources /home/ldez /home /]
INFO [config_reader] Used config file .golangci.toml
INFO [lintersdb] Active 75 linters: [asciicheck bidichk bodyclose contextcheck cyclop deadcode decorder depguard dogsled dupl durationcheck errcheck errchkjson errname errorlint exhaustive exhaustivestruct exportloopref forbidigo forcetypeassert funlen gochecknoglobals gochecknoinits gocognit gocritic gocyclo godot goerr113 gofmt gofumpt goheader goimports gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper ifshort importas ineffassign ireturn lll maintidx makezero misspell nakedret nilerr nilnil nlreturn noctx nolintlint prealloc predeclared promlinter revive rowserrcheck sqlclosecheck staticcheck structcheck stylecheck tenv testpackage thelper tparallel typecheck unconvert unparam unused varcheck wastedassign whitespace wrapcheck wsl]
INFO [loader] Go packages loading at mode 575 (files|name|compiled_files|deps|exports_file|imports|types_sizes) took 84.422958ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 92.734µs
WARN [linters context] bodyclose is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] contextcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
INFO [linters context] importas settings found, but no aliases listed. List aliases under alias: key.
INFO [linters context/goanalysis] analyzers took 0s with no stages
WARN [linters context] gosimple is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] nilerr is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] noctx is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] rowserrcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] sqlclosecheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] staticcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] stylecheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] tparallel is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] unparam is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] wastedassign is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters context] unused is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.
INFO [runner] Processors filtering stat (out/in): autogenerated_exclude: 1/1, max_per_file_from_linter: 1/1, max_from_linter: 1/1, source_code: 1/1, cgo: 1/1, skip_dirs: 1/1, exclude-rules: 1/1, path_shortener: 1/1, path_prefixer: 1/1, filename_unadjuster: 1/1, uniq_by_line: 1/1, diff: 1/1, max_same_issues: 1/1, sort_results: 1/1, path_prettifier: 1/1, skip_files: 1/1, identifier_marker: 1/1, exclude: 1/1, nolint: 1/1, severity-rules: 1/1
INFO [runner] processing took 147.173µs with stages: identifier_marker: 43.152µs, path_prettifier: 28.435µs, nolint: 27.906µs, autogenerated_exclude: 17.009µs, source_code: 11.288µs, skip_dirs: 6.524µs, exclude-rules: 6.087µs, uniq_by_line: 1.114µs, cgo: 1.031µs, max_from_linter: 922ns, path_shortener: 797ns, filename_unadjuster: 628ns, max_per_file_from_linter: 521ns, max_same_issues: 476ns, skip_files: 389ns, exclude: 278ns, severity-rules: 210ns, diff: 189ns, sort_results: 124ns, path_prefixer: 93ns
INFO [runner] linters took 90.744789ms with stages: goanalysis_metalinter: 90.396075ms, structcheck: 26.643µs, stylecheck: 25.653µs, unparam: 23.117µs, bodyclose: 11.57µs, tparallel: 7.828µs, wastedassign: 7.049µs, gosimple: 6.766µs, unused: 6.366µs, staticcheck: 5.97µs, contextcheck: 5.413µs, noctx: 4.006µs, nilerr: 3.932µs, rowserrcheck: 3.751µs, sqlclosecheck: 3.677µs
INFO fixer took 0s with no stages
main.go:6:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
fmt.Println("Hello")
^
INFO File cache stats: 1 entries of total size 66B
INFO Memory: 3 samples, avg is 50.2MB, max is 53.0MB
INFO Execution took 181.724714ms can you provide an example? (at least a files tree and go.mod files content) |
I'm also having this error while running golangci-lint on CI but can't reproduce it locally (I tried running I'm using a |
OK, a Here is a repo to reproduce
It should show a warning:
|
Problem fixed by v0.2.3. |
Welcome
Description of the problem
After upgrading to Go 1.18 and converting my project to a multi-module repo I get the following warning when trying to do
golang-lint run ./...
on my project.Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository
// add your code here
The text was updated successfully, but these errors were encountered: