Skip to content

cmd/go: the vendor/ folder should be kept up to date if present #29058

Closed
@FiloSottile

Description

@FiloSottile

Using go mod vendor is great for backwards compatibility (and for self-contained builds), but it requires re-running every time any dependency changes. Multiple times now I have committed changes that I tested with GO11MODULES=on, only to have them fail in CI where they rely on vendor/.

The go tool already updates go.mod and go.sum when making builds, I believe it should do the same with the vendor/ folder if it's present, to avoid getting in an inconsistent state.

An out of date vendor/ folder feels like an entirely inconsistent and confusing state to be in, causing builds to unexpectedly fail only for certain users, with no advantages, so the tooling should probably just not let it happen. If a developer doesn't want to keep the vendor/ folder up to date, it should be deleted.

/cc @rsc @bcmills

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.FrozenDueToAgeGoCommandcmd/goNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.modules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions