Skip to content
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

Improper isStdlib() path check using strings.HasPrefix() #147

Closed
jingyuanliang opened this issue Sep 14, 2022 · 2 comments
Closed

Improper isStdlib() path check using strings.HasPrefix() #147

jingyuanliang opened this issue Sep 14, 2022 · 2 comments

Comments

@jingyuanliang
Copy link
Contributor

jingyuanliang commented Sep 14, 2022

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

return strings.HasPrefix(pkg.GoFiles[0], build.Default.GOROOT)
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.

@Bobgy
Copy link
Collaborator

Bobgy commented Sep 14, 2022

looks like we can just check prefix /usr/local/go/ instead

@Bobgy
Copy link
Collaborator

Bobgy commented Sep 14, 2022

Duplicate of #38

@Bobgy Bobgy marked this as a duplicate of #38 Sep 14, 2022
@Bobgy Bobgy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants