Skip to content

cmd/go: emit an error in 'go mod vendor' if any replacement is in the vendor directory #29169

Closed
@bcmills

Description

@bcmills

There is significant overlap between replace directives and the vendor directory, and users sometimes conflate the two (#29079 (comment)).

Since go mod vendor removes and replaces the entire contents of the vendor directory, it will fail (or at least produce very confusing behavior) if a replace directive points into vendor. We should detect that condition explicitly and emit a useful error.

(CC @jayconrod)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions