-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[x/tour] tour: look for content in module cache, not GOROOT/misc/tour
Tour content hasn't been available in GOROOT since Go 1.12¹, so stop looking for it there. A more useful fallback place to find tour content is the module cache. When the golang.org/x/tour is in the build list, it will be found via build.Import. It will not be found, however, when the tour binary is run outside of a module. This situation is more common as of Go 1.16, since the default GO111MODULE value changed to on². If the version of the tour binary is known, access the content for that version from the module cache. In the future, this complex and imperfect machinery will be replaced with simply embedding the needed files in the binary. We can't do that quite yet (not without duplicating a lot of code) because Go 1.15 is supported, and because Go 1.14 is used for deployment. It's not neccessary to provide a custom socket.Environ (which served to provide a custom GOPATH value pointing inside GOROOT; that path is being removed here). Delete it along with some other unused code. ¹ https://golang.org/doc/go1.12#tour ² https://golang.org/doc/go1.16#modules Fixes golang/go#44243. Change-Id: Ia239700170b8614d21cafe9617b51dddf3e337d5 Reviewed-on: https://go-review.googlesource.com/c/tour/+/298529 Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Dmitri Shuralyov <[email protected]> Reviewed-by: Russ Cox <[email protected]> X-Tour-Commit: b3263fcf7749f3600c8928d5f7d4e8a66a34b74f
- Loading branch information
1 parent
fa7a8b8
commit c4858c3
Showing
3 changed files
with
38 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters