Skip to content

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

@karlkfi

Description

@karlkfi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions