Very minor tweaks:
- Remove (c) pseudosymbol.
- Remove "All Rights Reserved."
- Change "Google Inc." (no longer exists) to "Google LLC".
[git-generate]
echo '
,s/\(c\) //
,s/ All rights reserved.//
,s/Google Inc./Google LLC/
w
q
' | sam -d LICENSE
Change-Id: I7aa6d7ae247f06f8500155ed1a53db14bd959bd6
Reviewed-on: https://go-review.googlesource.com/c/tour/+/598530
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Russ Cox <rsc@golang.org>
Done with:
go get go@1.18
go mod tidy
go fix ./...
Using go1.21.3.
For golang/go#60268.
Change-Id: Iffde5a8298df8aa6c9ae17c73016e0669bba725d
Reviewed-on: https://go-review.googlesource.com/c/tour/+/534735
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Dmitri Shuralyov <dmitshur@google.com>
In 2009, Google's open-source lawyers asked us to create the AUTHORS
file to define "The Go Authors", and the CONTRIBUTORS file was in
keeping with open source best practices of the time.
Re-reviewing our repos now in 2022, the open-source lawyers are
comfortable with source control history taking the place of the
AUTHORS file, and most open source projects no longer maintain
CONTRIBUTORS files.
To ease maintenance, remove AUTHORS and CONTRIBUTORS from all repos.
For golang/go#53961.
Change-Id: I9ff618b0e8147821e0bd00c850c9ce13b9c16e29
Reviewed-on: https://go-review.googlesource.com/c/tour/+/418925
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
This adds an introductory tutorial on building a small RESTful API using Go
and the Gin web framework.
This change includes content on:
- Using the Gin web framework
(https://pkg.go.dev/github.com/gin-gonic/gin).
- Creating an API that includes three HTTP method-and-endpoint
combinations.
- GET and POST actions that convert between a Go struct and JSON.
- Supporting URL path parameters.
- Go command-line tools such as `go get` and `go run`.
This content is written in the enhanced Markdown format supported by the
interactive tutorial application in the Google Cloud Shell Editor.
For more, see https://cloud.google.com/shell/docs/cloud-shell-tutorials/tutorials
Change-Id: I216ec12763af83db257c978997a2987eae418995
Reviewed-on: https://go-review.googlesource.com/c/tour/+/328611
Trust: Steve Traut <straut@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
“A Tour of Go” moved to golang.org/x/website in CL 322790.
The supporting packages stay.
We may also use this repo for some other tours in the future.
Change-Id: Icb60bb9c1e4fe2e9b532108e3aefab24715c7c91
Reviewed-on: https://go-review.googlesource.com/c/tour/+/324309
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Nothing in this package or its dependencies uses this variable,
after CL 293449.
Change-Id: I82972cbb7abbeff6c3f4ca757c61ba966b666c19
Reviewed-on: https://go-review.googlesource.com/c/tour/+/295489
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
The final 'Where to Go from here...' page of the tour suggests, as
next step, to look at a YT screencast titled 'Writing, building,
installing, and testing Go code', or to read the 'How To Write Go
Code' document. The screencast is from 2012, so of course it shows the
old GOPATH workflow.
This change removes the link to the video, and leaves the suggestion
to read 'How To Write Go Code', to make sure beginners won't start
using the legacy GOPATH-based workflow.
Fixesgolang/tour#1089
Change-Id: Ib826298127d8465055c85a2537732e61ff21cdb0
Reviewed-on: https://go-review.googlesource.com/c/tour/+/319429
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
After appspot deprecated Go 1.9, a few of the tour translations we
link to went offline. I've reported the issue on their issue trackers
6 month ago (Issue golang/tour#1039 tracks this). A few of them were
redeployed and went back online, but others are still offline (and now
appspot returns a 500 Internal Server Error status for those).
After a 6 months grace period, this change removes the links to the
translations that are still offline from the welcome page.
Updates golang/tour#1039
Updates golang/go#41219Fixesgolang/go#44382
Change-Id: I82bab0b78273b5b26dab0714ed6e6e6feaea1725
Reviewed-on: https://go-review.googlesource.com/c/tour/+/298209
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
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#modulesFixesgolang/go#44243.
Change-Id: Ia239700170b8614d21cafe9617b51dddf3e337d5
Reviewed-on: https://go-review.googlesource.com/c/tour/+/298529
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
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>
The korean translation we link to is offline due to the
Go 1.9 is no longer available.
error; but even before that it was quite outdated (last re-deployment
was ~6 years ago).
A few people have been working on an updated translation, which they
deployed at go-tour-ko.appspot.com (repo github.com/golang-ko/tour).
I don't speak korean but I've skimmed through it and it looks fine.
Link to the new one.
Updates golang/tour#1026Fixesgolang/tour#709Fixesgolang/tour#1027
Change-Id: I08edb12737a82381aeb33bb3f324e87b92936115
Reviewed-on: https://go-review.googlesource.com/c/tour/+/253337
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Previously, the entire image was encoded into a buffer,
then encoded to a base64 string, which was concatenated
with another string, and written to stdout in one swoop.
We can do this more efficiently by writing the PNG image
to a base64 encoder directly, and using buffered I/O to
batch writes to stdout into moderately-sized chunks.
As an added bonus, though really the main motivation for
doing this optimization now, this helps avoid triggering
the golang/go#38751 issue on the Go Playground.
Switch to the best compression level instead of the default,
reducing encoded image size at the cost of extra computation.
Playground snippets need to be transferred over the network
and kept in storage, so it should be a favorable trade-off.
This CL was based on CL 232177.
For golang/go#38751.
Change-Id: I565fe538aa15910caaff98be156ac64b0d35fff4
Co-authored-by: Alexander Rakoczy <alex@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/tour/+/232867
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
It's hard to write a normal test because ShowImage writes
to os.Stdout unconditionally. Add an example test instead.
Change-Id: I52e02908e94aa212a05c058edb4f504851b5bb8d
Reviewed-on: https://go-review.googlesource.com/c/tour/+/232866
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Effective Go¹ says every package should have a package comment,
and every exported name in a package should have a doc comment.
This package is mentioned in the Go tour. Let's set a good example.
¹ https://golang.org/doc/effective_go.html#commentary
Change-Id: Iac561c7530fc49d5ff17c51d925151ec8319ef24
Reviewed-on: https://go-review.googlesource.com/c/tour/+/232865
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Issues with the tour code should be reported in the tracker at
github.com/golang/go/issues
While the 'report bug' button in the tour itself points to the
issue tracker at
github.com/golang/tour/issues
which is the one where issues about the tour's content should
be reported. Make this clear in the README.
Fixesgolang/go#36843
Change-Id: I7844ea1a15470fdfbc970a9485d37250a6c38779
Reviewed-on: https://go-review.googlesource.com/c/tour/+/217357
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
After update to Go 1.12 (in CL 198320), the local server is not needed (or even available).
Instead these new instructions will start a local instance.
Change-Id: Ie24b9c9f902ebd70d3b3b9ff8d2c4aa49be631bd
GitHub-Last-Rev: b3facf0d8d
GitHub-Pull-Request: golang/tour#880
Reviewed-on: https://go-review.googlesource.com/c/tour/+/212999
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Nearly all sync.Mutex members in the standard library are named mu,
or use "mu" as part of the name. While this isn't a documented
recommendation anywhere that I can find, it would seem nice to start
new users with this same convention.
Change-Id: I67cbe2a0052b81d8bb57d5ece0cefd2f3838f298
GitHub-Last-Rev: 31ef869d9b
GitHub-Pull-Request: golang/tour#813
Reviewed-on: https://go-review.googlesource.com/c/tour/+/192725
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
When deployed with App Engine on tour.golang.org,
insert analytics HTML at the beginning of <head>.
Add deploy instructions to the README.
Also update to the App Engine Go 1.12 runtime.
Change-Id: Ib3333290783f34eb00843006cf949308302b342d
Reviewed-on: https://go-review.googlesource.com/c/tour/+/198320
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Re-add the link to installing Go on the welcome/3 slide,
because it's a pre-requisite for being able to run go get.
This was included before, but got lost in a refactor after
the tour binary moved out of the Go distribution.
Additionally, make it more clear that installing the tour
locally is an optional step that only needs to be done if
one wishes to run the tour offline; it's not mandatory to
get through the tour. Running the tour online has a lower
overhead, and should help keep the tour accessible to more
people.
Fixesgolang/go#34585
Updates golang/go#24819
Change-Id: If5f51e9e876722a86afca054bf78428f78bb3076
Reviewed-on: https://go-review.googlesource.com/c/tour/+/197857
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
The concurrency/7 slide (the binary tree exercise) says:
> There can be many different binary trees with the same sequence of
values stored at the leaves.
Which is misleading: in the btree in the exercise, values are not
stored just in the leaves, the internal nodes hold values too.
Fixesgolang/tour#774
Change-Id: I71af71ccf36ac8ad87dfe73b751b461890c3a7e0
Reviewed-on: https://go-review.googlesource.com/c/tour/+/179937
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This change improves the algorithm that detects the "#appengine:"
blocks to make the space after colon optional rather than mandatory.
That makes it possible to have an empty line with the "#appengine:"
prefix, without requiring a trailing space after the colon. It's
convenient whenever such a block contains multiple paragraphs, e.g.:
#appengine: * Go offline
#appengine:
#appengine: This tour is also available as a stand-alone program
#appengine: that you can use without access to the internet.
#appengine:
#appengine: The stand-alone tour is faster, as it builds and runs
#appengine: the code samples on your own machine.
People often have editors set to trim trailing whitespace on save,
so it's helpful to improve the algorithm, instead of having significant
trailing whitespace and relying on people to not accidentally remove it.
Now that the trailing whitespace is no longer signifiant, remove it.
Also fix a typo: s/non-blank like/non-blank line/.
Change-Id: I42d41634dd30e307ac98214cb94b1f97a8032f08
Reviewed-on: https://go-review.googlesource.com/c/tour/+/167837
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
The trailing spaces on empty 'appengine:' lines were removed at some
point, but those spaces are actually critical to making the formatting
work.
Take a look at https://tour.golang.org/welcome/3 to see how it's broken;
there are no line breaks or code block formatting.
The algorithm for transforming the 'appengine:' blocks could be
improved, but the easy fix right now is to restore the trailing spaces.
Change-Id: I1d2ba085e4b09099b073a521ca20e4333e69bbe9
Reviewed-on: https://go-review.googlesource.com/c/tour/+/165477
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Commands run:
go mod init
go mod edit -go=1.11
go mod tidy
go list -m all
go test ./...
Updates golang/go#30228
Change-Id: I3d7e4f59a98822691177973ec2d7a55a6216b78c
Reviewed-on: https://go-review.googlesource.com/c/tour/+/167181
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This change upgrades the deployment of tour to use the newer
Go 1.11 runtime. As part of that, the appengine build tag is
removed (it's no longer set by App Engine), and the GAE_ENV
environment variable is used to detect when tour is being run
in App Engine mode.
Set an environment variable in app.yaml to configure the
x/tools/godoc/golangorgenv package appropriately.
Factor out the static file handlers in local.go, but keep
static file handlers in app.yaml for improved latency across
global regions.
Updates golang/go#30486
Change-Id: Ia5bc88aab34fd07bf6ff0785da831180f509156f
Reviewed-on: https://go-review.googlesource.com/c/tour/+/165537
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Currently, go-tour-es.appspot.com is a 404, but the correct link
for Spanish tutorial can be seen at gotour-es.appspot.com.
Change-Id: I3e3f34a6e72fb59283c8a282b5e996babdf1e9f3
GitHub-Last-Rev: ce817cb3e1
GitHub-Pull-Request: golang/tour#687
Reviewed-on: https://go-review.googlesource.com/c/158918
Reviewed-by: Andrew Bonventre <andybons@golang.org>
The new README for the tour has a similar markdown structure to the
blog, and includes instructions for filing issues and running local
servers.
Change-Id: I8392598d78d4c9b3c0341c38f0a64c52a2aac070
Reviewed-on: https://go-review.googlesource.com/c/148038
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
A missing \n doesn't matter when running the playground in the
browser, but apparently sometimes people copy the tour code snippets
in their editors; and anyway it's probably slightly nicer to be
consistent with the newlines.
Fixesgolang/tour#642
Change-Id: I24d048e96620cbdaa668644e1460749cbea66ac5
Reviewed-on: https://go-review.googlesource.com/c/148617
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Change favicon.ico to newer high resolution version from main project.
Change-Id: Iba9a5b13cb9615eaf10167a531065b9f8e101a71
Reviewed-on: https://go-review.googlesource.com/c/148037
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Move the main Go files into the same directory as the app.yaml file.
This changes the command location to be at golang.org/x/tour instead
of golang.org/x/tour/gotour. Add a placeholder command in gotour so
that those who use the previous installation command will know to
use the new one and it won't just seem like it has vanished.
Also update the documentation to take into account that the tour is
no longer distributed with releases as of golang.org/cl/131156
Fixesgolang/go#28163
Change-Id: I60737f0cfaa93d12902a75fbc0924d96672a8c9b
Reviewed-on: https://go-review.googlesource.com/c/141857
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
The lack of agreement in tense between the parallel verbs `execute` (_are executed_) and `return` in this sentence threw me. This simpler construction is more grammatically correct, according to some standards, and less confusing to me.
Change-Id: I6351ce29a684d9b0d18f57b914072c43219401aa
GitHub-Last-Rev: c6f29ca49a
GitHub-Pull-Request: golang/tour#629
Reviewed-on: https://go-review.googlesource.com/c/141577
Reviewed-by: Rob Pike <r@golang.org>
Forcing the CodeEditor take its full parent height,
solves the issue when the code content was loading
slower, on Chrome. Also the yellow background was
added only on each line, and not on the editor,
resulting in a white box while lessons were loading.
Fixesgolang/tour#544
Change-Id: Ic94ba7bf284267f5b2e3ea359342ebca1a29f2b1
Reviewed-on: https://go-review.googlesource.com/122463
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
A few tour slides end with a Note with some additional remarks. Most
of the times the word "Note:" is in bold, and the next word is
capitalized, except in a few places. Uniform the style by making it
always bold and by always capitalizing the sentence.
Change-Id: Ib5843a55c0e9a4f602efa0346f96702493a7284a
Reviewed-on: https://go-review.googlesource.com/123215
Reviewed-by: Andrew Bonventre <andybons@golang.org>
CL 113998 changed
drop the ", value" entirely
into
drop the `, value` entirely.
in moretypes.article, but that's not rendered correctly because the
backspaces have a space in it, which is not allowed. Screenshot:
https://i.imgur.com/dDXNl6X.png
Keep the backticks, but take the space out.
Change-Id: If702d69d2d0086bcfca7b14f8e020a8c152edf36
Reviewed-on: https://go-review.googlesource.com/123235
Reviewed-by: Andrew Bonventre <andybons@golang.org>