A lightweight tool to report on the licenses used by a Go package and its dependencies. Highlight! Versioned external URL to licenses can be found at the same time.
Apache License 2.0
833
stars
125
forks
source link
Improper `isStdlib()` path check using `strings.HasPrefix()` #147
I have a setup where my GOROOT is /usr/local/go and source files are stored under /usr/local/google. go-licenses doesn't output anything in this case. I've traced it down and it's due to https://github.com/google/go-licenses/blob/13c8b648ff73469070f7f19c53dfbb88434370c4/licenses/library.go#L289 where build.Default.GOROOT got /usr/local/go and pkg.GoFiles[0] got /usr/local/google/... so it thinks everything is stdlib, then skips all of them.
I have a setup where my
GOROOT
is/usr/local/go
and source files are stored under/usr/local/google
. go-licenses doesn't output anything in this case. I've traced it down and it's due to https://github.com/google/go-licenses/blob/13c8b648ff73469070f7f19c53dfbb88434370c4/licenses/library.go#L289 wherebuild.Default.GOROOT
got/usr/local/go
andpkg.GoFiles[0]
got/usr/local/google/...
so it thinks everything is stdlib, then skips all of them.