]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/load: always use DefaultExecName to determine binary name
authorDmitri Shuralyov <dmitshur@golang.org>
Thu, 21 Mar 2019 18:00:46 +0000 (14:00 -0400)
committerDmitri Shuralyov <dmitshur@golang.org>
Tue, 26 Mar 2019 19:49:02 +0000 (19:49 +0000)
commite007916cea969c4d5917da931413fba4eb43e8f6
treea3a438e495302ed173cf954b864bee99027a1fc3
parentdb7e74696087edefd03162583cc8d45ad5bd2f06
cmd/go/internal/load: always use DefaultExecName to determine binary name

It should produce equivalent results to split on the import path of the
package rather than its directory, in GOPATH mode. That means the common
code in DefaultExecName can be used.

We're in the middle of Go 1.12 cycle, so now is a good time to make it
happen for Go 1.13.

Modify isVersionElement to accept path elements like "v2", "v3", "v10",
rather than "/v2", "/v3", "/v10". Then use it in DefaultExecName instead
of the ad-hoc isVersion function. There is no change in behavior.

Add tests for DefaultExecName and isVersionElement.

Updates #26869

Change-Id: Ic6da2c92587459aa2b327385e994b72a6e183092
Reviewed-on: https://go-review.googlesource.com/c/go/+/168678
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/pkg_test.go [new file with mode: 0644]