|author||Dmitri Shuralyov <email@example.com>||Wed Mar 03 19:35:43 2021 -0500|
|committer||Dmitri Shuralyov <firstname.lastname@example.org>||Fri Mar 05 16:09:21 2021 +0000|
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@example.com> TryBot-Result: Go Bot <firstname.lastname@example.org> Trust: Dmitri Shuralyov <email@example.com> Reviewed-by: Russ Cox <firstname.lastname@example.org>
A Tour of Go is an introduction to the Go programming language. Visit https://tour.golang.org to start the tour.
To install the tour from source, first install Go and then run:
$ go get golang.org/x/tour
This will place a
tour binary in your workspace's
bin directory. The tour program can be run offline.
Contributions should follow the same procedure as for the Go project: https://golang.org/doc/contribute.html
To run the tour server locally:
go run .
Your browser should now open. If not, please visit http://localhost:3999/.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The issue tracker for the tour's code is located at https://github.com/golang/go/issues. Prefix your issue with “x/tour:” in the subject line, so it is easy to find.
Issues with the tour's content itself should be reported in the issue tracker at https://github.com/golang/tour/issues.
To deploy tour.golang.org, run:
GO111MODULE=on gcloud --project=golang-org app deploy --no-promote app.yaml
This will create a new version, which can be viewed within the golang-org GCP project.
Check that the deployed version looks OK (click the version link in GCP).
If all is well, click “Migrate Traffic” to move 100% of the tour.golang.org traffic to the new version.
Unless otherwise noted, the go-tour source files are distributed under the BSD-style license found in the LICENSE file.