-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Typechecking failes using go 1.11 modules #237
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
Comments
I have exactly the same problem. |
Looks like the same as the reason for #178 My current temporary solution is to manually skip these files with this config: run:
skip-files:
- ".*/pkg/mod/.*$" |
@nezorflame That did not work for us :/ What does work for us is targeting our specific packages when running
That being said, it is not optimal, as you will have to add new arguments to your command if new pacakges or files are added |
@franzwilhelm yeah, both of these workarounds are suboptimal, hope that real fix is coming soon. |
Any news ? This prevents us to use go modules. Thx ! |
Hi! |
Use go/packages instead of x/tools/loader: it allows to work with go modules and speedups loading of packages with the help of build cache. A lot of linters became "fast": they are enabled by --fast now and work in 1-2 seconds. Only unparam, interfacer and megacheck are "slow" linters now. Average project is analyzed 20-40% faster than before if all linters are enabled! If we enable all linters except unparam, interfacer and megacheck analysis is 10-20x faster!
Use go/packages instead of x/tools/loader: it allows to work with go modules and speedups loading of packages with the help of build cache. A lot of linters became "fast": they are enabled by --fast now and work in 1-2 seconds. Only unparam, interfacer and megacheck are "slow" linters now. Average project is analyzed 20-40% faster than before if all linters are enabled! If we enable all linters except unparam, interfacer and megacheck analysis is 10-20x faster!
Use go/packages instead of x/tools/loader: it allows to work with go modules and speedups loading of packages with the help of build cache. A lot of linters became "fast": they are enabled by --fast now and work in 1-2 seconds. Only unparam, interfacer and megacheck are "slow" linters now. Average project is analyzed 20-40% faster than before if all linters are enabled! If we enable all linters except unparam, interfacer and megacheck analysis is 10-20x faster!
Use go/packages instead of x/tools/loader: it allows to work with go modules and speedups loading of packages with the help of build cache. A lot of linters became "fast": they are enabled by --fast now and work in 1-2 seconds. Only unparam, interfacer and megacheck are "slow" linters now. Average project is analyzed 20-40% faster than before if all linters are enabled! If we enable all linters except unparam, interfacer and megacheck analysis is 10-20x faster!
Use go/packages instead of x/tools/loader: it allows to work with go modules and speedups loading of packages with the help of build cache. A lot of linters became "fast": they are enabled by --fast now and work in 1-2 seconds. Only unparam, interfacer and megacheck are "slow" linters now. Average project is analyzed 20-40% faster than before if all linters are enabled! If we enable all linters except unparam, interfacer and megacheck analysis is 10-20x faster!
go/packages are supported in release v1.11 |
When migrating to go 1.11 modules I move our git repo outside of GOPATH and ran
go mod init
thengo mod vendor
. Unfortunately golangci-lint has a few errors that crop up from the typecheck lint. Disabling that lint results in errors:golangci-lint run --no-config --disable-all -E megacheck ./config WARN [runner/megacheck] Can't run megacheck because of compilation errors in packages [github.com/evalphobia/logrus_sentry github.com/stretchr/testify/assert]: ../../../go/pkg/mod/github.com/evalphobia/[email protected]/sentry.go:341: invalid operation: hook.client (variable of type *github.com/getsentry/raven-go.Client) has no field or method SetEnvironment and 2 more errors: run `golangci-lint run --no-config --disable-all -E typecheck` to see all errors
Please include the following information:
golangci-lint --version
(or git commit if you don't use binary distribution)go version && go env
golangci-lint run -v
Here is the import list of the files I'm attempting to lint:
config/config.go
config/config_test.go
The text was updated successfully, but these errors were encountered: