|author||Dmitri Shuralyov <firstname.lastname@example.org>||Fri Jan 10 17:34:30 2020 -0500|
|committer||Dmitri Shuralyov <email@example.com>||Mon Jan 13 21:05:48 2020 +0000|
internal/genv: find directory to write output with module mode in mind The goal of this change is to prevent genv from potentially writing its output in the wrong location. genv has been relying on os.Getenv("GOPATH") to figure out where to write its output. This stopped working reliably after Go 1.8 started having a default GOPATH value.¹ Back then, it was possible to start using 'go env GOPATH' instead. However, with the introduction of module mode in Go 1.11, there isn't a way to reliably pinpoint the canonical location of a development copy of a module, because that module can be placed in anywhere on the system. So, start requiring that genv is run inside the golang.org/dl module. At that point, it is possible to find the module root reliably. Add a Go 1.13+ build constraint in order to use errors.As without adding a requirement to golang.org/x/xerrors module. genv is a tool used only by contributors to this module, so it doesn't need to support Go 1.12. Also add a missing copyright header to a test file. ¹ https://golang.org/doc/go1.8#gopath Change-Id: Ia65e6cbb07d69481214708afaee15adb104f782c Reviewed-on: https://go-review.googlesource.com/c/dl/+/214386 Run-TryBot: Dmitri Shuralyov <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Alexander Rakoczy <firstname.lastname@example.org> Reviewed-by: Carlos Amedee <email@example.com>
This repository holds the Go wrapper programs that run specific versions of Go, such as
go get golang.org/dl/go1.10.3 and
go get golang.org/dl/gotip.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html. The main issue tracker for the net repository is located at https://github.com/golang/go/issues. Prefix your issue with “dl:” in the subject line, so it is easy to find.