OpenPeeDeeP / depguard

Go linter that checks if package imports are in a list of acceptable packages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

depguard: create analyzer: couldn't expand $gostd: could not read GOROOT directory

hidu opened this issue · comments

commented
  1. build golangci-lint on computer A but execute it on computer B
  2. computer B without $GOROOT env value,but has other go version

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)

Tagged new commit with PR that should fix this.