Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cmd/go: custom import path checking should not apply to github.com/xxx/yyy #10952

Closed
rsc opened this issue May 26, 2015 · 1 comment
Closed
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented May 26, 2015

I think we should probably relax things so that github.com/xxx/yyy does not get a custom import path check unless it has an import comment.

---------- Forwarded message ----------
From: Dan Kortschak dan.kortschak@adelaide.edu.au
Date: Thu, May 21, 2015 at 8:10 PM
Subject: proposal to make import path checking only error when custom import is defined
To: golang-dev@googlegroups.com, Russ Cox rsc@golang.org

The custom import path checking proposal[1] says, "The go command will
refuse to install a package with an import comment under any import path
except the one named in the comment." However, the current behaviour is
to refuse whenever there is a mismatch between the import path and the
repo does not match the root, irrespective of whether a custom import
was defined. To my reading the current behaviour is not what was
specified in the proposal.

This gets a number of user/developers who expect to be able to update
their package originally checked out with git: by using go get. An an
example is here[2].

There are two possible approaches to fixing this - both trivial,
depending on checking that p.ImportComment != "" in
cmd/go/downloadPackage[3] and either issuing a non-misleading error
(don't mention custom import paths since there was none) or just allow
the completion of the request.

Are either of these acceptable?

[1]https://golang.org/s/go14customimport
[2]https://groups.google.com/d/topic/golang-nuts/Zi-Kw2tbif8/discussion
[3]

if remote != repo {

@rsc rsc added this to the Go1.5 milestone May 26, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/10693 mentions this issue.

@rsc rsc closed this as completed in 64078bf Jun 27, 2015
@golang golang locked and limited conversation to collaborators Jun 27, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants