You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your go-root is (for example) /home/ubuntu/go and your gopath is /home/ubuntu/gopath, go-licenses will treat all dependencies as stdlib and therefore ignore them.
Bobgy
changed the title
Libraries are ignored when gopath is poorly chosen
Libraries are ignored when goroot and gopath share the same prefix
Sep 14, 2022
If your go-root is (for example) /home/ubuntu/go and your gopath is /home/ubuntu/gopath, go-licenses will treat all dependencies as stdlib and therefore ignore them.
The issue lies here: https://github.com/google/go-licenses/blob/master/licenses/library.go#L204
When packages are stored inside the gopath, their path will start with /home/ubuntu/gopath, and as /home/ubuntu/go is a prefix of this, go-licenses thinks these packages belong to the stdlib.
The solution would be to append a path-seperator to build.Default.GOROOT (if it does not already end in one) before performing the prefix-check.
The text was updated successfully, but these errors were encountered: