Skip to content

cmd/go: check for change in custom import path repo even without import comment #16471

Closed
@jba

Description

@jba
  1. What version of Go are you using (go version)? go 1.6

This is a re-open of #10952. The issue was that a change to the form of a repo's URL would lead to an erroneous error during "go get -u". In that case, the error alluded to a custom import path even though there wasn't one.

The fix was to only perform the check if the package had an import comment. This conflates having a custom import path with having an import comment. If (a) there is a custom import path, (b) there is no import comment, and (c) the repo pointed to by the import path changes, then "go get -u" will incorrectly pull from the old repo.

The right fix is to resolve the import path to a repo URL, and compare that to the origin of the local repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions