On Wed, Jan 20, 2021 at 9:03 PM Marvin Renich <m...@renich.org> wrote:

> I still cannot find any mention of reserved import paths in any
> documentation (go help modules/importpath/gopath).  It's just an issue
> on the tracker.

When an important part of the implementation is undocumented then it's
a documentation bug, hence the issue.

> Import paths without a dot in the first component (which is how I read
> what this issue is trying to claim as "reserved") have been part and
> parcel of the GOPATH way of building user packages since the beginning
> of the go tool, and this still works perfectly.  Not everyone wants or
> needs to put their go source code in a web-accessible location, or even
> in a version control system, for that matter.

Import path is not an URL. The Go build system in GOPATH does not
interpret import paths as URLs. It's only the go get command that uses
a well defined function for going from import path to URL to
download/update repositories.

>From the POV of the build system, Import paths refer to file system
locations, again using a well defined function for that.

> Changing this for GOPATH
> mode would, in my mind, be a major breaking change.

IMO it's a security issue that needs to be fixed. If anything puts a
replacement of some stdlib package in your $GOPATH then you may have a
problem.

Even on an uncompromised system, using the reserved path may in future
clash with a new package of the same name added to stdlib, producing a
log of confusion about why this bunch of packages build just fine and
the rest does not.

> I have never seen any mention of this issue on golang-nuts, though I
> certainly could have missed it.  Perhaps some discussion took place on
> golang-dev.  For a change this important, I would expect it to be
> publicized much better.  If this is only going to affect module mode,
> that is a different matter.

I don't recall where I became aware of the linked issue. It's too long ago.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-UTJJwpW28gxS0bwujGjLOqXty_1cx2v2%3DML%2BacOL8R9Q%40mail.gmail.com.

Reply via email to