depguard: create analyzer: couldn't expand $gostd: could not read GOROOT directory
hidu opened this issue · comments
hidu commented
- build golangci-lint on computer A but execute it on computer B
- computer B without $GOROOT env value,but has other go version
Adam Shannon commented
The error can be reproduced by using a GOROOT other than what the binary was built with. (Computer A vs Computer B)
You can resolve the issue by faking the runtime GOROOT to match the builders GOROOT.
Example: golangci/golangci-lint#3862 (comment)
More Info: golangci/golangci-lint#3862 (comment)
Will Dixon commented
Tagged new commit with PR that should fix this.