Skip to content

x/tools/cmd/goimports: always choose internal copy over outer copy #10339

@rsc

Description

@rsc

If someone is working in a tree where they have gone to the trouble to vendor a package, as long as the vendored copy is visible (not blocked by internal) we should make sure the vendored copy is always preferred. Otherwise goimports may hurt more than it helps in these situations.

Once there is a standard config file explaining what has been vendored, goimports could just read it and when it wants to use X but there's a vendored copy visible, use the vendored copy instead.

This came up in a private discussion with an external project about vendoring.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions