commit | b72029adf3393d3635828fedcddd5ae7053d3250 | [log] [tgz] |
---|---|---|
author | Dmitri Shuralyov <dmitshur@golang.org> | Sat Feb 13 17:41:38 2021 -0500 |
committer | Dmitri Shuralyov <dmitshur@golang.org> | Thu Mar 04 02:13:20 2021 +0000 |
tree | c3d5051608c9fd17cc97ca4d3a0dd51403440d2f | |
parent | 004403599411fcd726b1e58cd0199083507d2047 [diff] |
tour: build snippets in module mode We want to start building snippets in module mode rather than legacy legacy GOPATH mode, to make tour work well when there's no tour code in GOPATH/src and to be more future-proof. Building in module mode means we need to specify a go.mod file to use for each snippet. The tour web UI design predates the module mode and its go.mod files. Txtar-based multi-file support was added to the playground (that the tour uses for executing snippets) in golang.org/issue/32040, but the web UI hasn't been updated to have first-class separate <textarea> elements or tabs for editing multiple files. For now, we can get by with providing a default go.mod file for all tour snippets, since they only need some packages in the tour module. Update to a newer version of the golang.org/x/tools/playground/socket package which includes multi-file snippet support added in CL 204237. For golang/go#44243. Change-Id: Ib05725c52fbe43658b2f22ac728b1e901e635824 Reviewed-on: https://go-review.googlesource.com/c/tour/+/291889 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.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.
You're done.
Unless otherwise noted, the go-tour source files are distributed under the BSD-style license found in the LICENSE file.