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

go-licenses check errors when using replace in go.mod #310

Open
karlkfi opened this issue Feb 1, 2025 · 1 comment
Open

go-licenses check errors when using replace in go.mod #310

karlkfi opened this issue Feb 1, 2025 · 1 comment

Comments

@karlkfi
Copy link

karlkfi commented Feb 1, 2025

When using a replace directive in go.mod to point to a repo-local directory, like ./third_party/, go-licenses check ./vendor/... errors.

Example error:

F0131 19:17:31.165207 3484068 main.go:75] licenses.Find: rootDir /home/<me>/workspace/kpt-config-sync/internal/third_party/github.com/GoogleContainerTools/kpt should contain dir /home/<me>/workspace/kpt-config-sync/vendor/github.com/GoogleContainerTools/kpt/internal/types

The replace directive used:

replace github.com/GoogleContainerTools/kpt => ./internal/third_party/github.com/GoogleContainerTools/kpt

It's unclear exactly why it errors, but it seems to be validating that the file is in the correct file path according to the package path. But with a replace directive, there are two copies of this dependency, one in ./vendor/github.com/GoogleContainerTools/kpt, vendored from ./internal/third_party/github.com/GoogleContainerTools/kpt.

@karlkfi
Copy link
Author

karlkfi commented Feb 1, 2025

FWIW, I was able to work around this issue by using --ignore on the vendored path (./vendor/github.com/GoogleContainerTools/kpt), but I'd rather not have to.

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

1 participant