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>
Showing
Please register or sign in to comment