Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Followup go/vcs FromDir change CL to cmd/go/vcs.go. #1

Closed
dmitshur opened this issue Mar 19, 2016 · 5 comments
Closed

Followup go/vcs FromDir change CL to cmd/go/vcs.go. #1

dmitshur opened this issue Mar 19, 2016 · 5 comments
Assignees

Comments

@dmitshur
Copy link
Member

The relevant change in go/vcs is golang/tools@5804fef.

In it, I said:

Import path is a '/'-separated path.

However, I didn't back that up with any sources, because it was hard to find something concrete, and I was hoping it'd be accepted via common knowledge. At least it should be enough for the golang.org/x/tools/go/vcs package. It was, and the change was reviewed with +2 in https://golang.org/cl/18461 and merged, resolving golang/go#7723.

I want to follow up that change and apply it to the very similar source in cmd/go/vcs.go file (in cmd/go command) where vcs.FromDir was originally copied from.

Motivation to do that:

  1. Keep the two pieces of code in sync, so it's easier to apply bug fixes to them in future, if any.
  2. Backport some fixes/improvements done to the x/tools/go/vcs version into cmd/go.
@dmitshur
Copy link
Member Author

I want to find some more definitive sources on what constitutes as an "import path" in the context of cmd/go build tool. The best sources, so far, seem to be:

  • go help importpath
  • go help packages

The build tool seems to expect schema-less URIs (or relative paths), which would dictate the forward slash. It says that ./ and ../ denote a relative path. For remote paths, it's implied by the examples and hint, that they're URIs.

The Go spec has less strict restrictions, as described at https://golang.org/ref/spec#Import_declarations. But we're interested in the definition of "import path" in the context of cmd/go only.

Thanks to @lramirez and @dominikh for help compiling the above.

@dmitshur
Copy link
Member Author

Also, this entire issue is very related to golang/go#11490.

@dmitshur
Copy link
Member Author

Created https://golang.org/cl/21345, awaiting review.

@dmitshur dmitshur self-assigned this Mar 31, 2016
@dmitshur
Copy link
Member Author

dmitshur commented Apr 8, 2016

It's been reviewed, need to follow up next.

@dmitshur
Copy link
Member Author

Also made https://golang.org/cl/21795, and they're both merged! Woohoo!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant