Граф коммитов

423 Коммитов

Автор SHA1 Сообщение Дата
Frederik Zipp 4056b246ea all: fix a lot of typos
Change-Id: I0754d18f4c3c3d5dfa0c34b4bc154a35ac20b917
Reviewed-on: https://go-review.googlesource.com/c/website/+/411794
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-06-15 16:32:49 +00:00
Dmitri Shuralyov 577a9fdbc0 website: update deploying sections in README files
Use the README in cmd/golangorg directory as the canonical location
for documenting the deployment process for websites served by that
command. The top-level README now redirects to it, just like the
README in tour directory.

Add more context on how the website uses tests to ensure that deploys
can be done safely.

While here, also shorten various URLs to use the new go.dev domain.

For golang/go#36707.
Updates golang/go#39687.

Change-Id: If5cf7a74b19830540b29612de37286c5f14244a1
Reviewed-on: https://go-review.googlesource.com/c/website/+/367994
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Katie Hockman <katie@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-06 17:29:19 +00:00
Russ Cox e77adb1f30 tour: serve from cmd/golangorg as go.dev/tour
tour.golang.org is the last independent server in this repository
and almost the last golang.org domain with user-facing content.
(talks.golang.org remains.)

We need to keep golang.org/x/website/tour as a runnable binary,
but move the logic into internal/tour so it can be used from both
the tour binary and cmd/golangorg.

After this is deployed, we will need to delete the current tour app
from the golang-org project, and then requests for tour.golang.org
will default to the main server (cmd/golangorg).

This will make the tour available in China for the first time,
at golang.google.cn/tour.

Change-Id: I0f025d8ae89e12489d26bb3bc380a833eeb57bcc
Reviewed-on: https://go-review.googlesource.com/c/website/+/365100
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22 16:43:07 +00:00
Russ Cox ab4f479b5c all: make golang.org and go.dev links relative
Now that there is one site, update all golang.org links to go.dev.
But for any links being served from go.dev, make host-relative,
so that when serving golang.google.cn, we stay on that host as
much as possible.

Change-Id: Id6e1303059b5522846a64202bc1a8b81dc3854cd
Reviewed-on: https://go-review.googlesource.com/c/website/+/365095
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22 16:42:44 +00:00
Russ Cox 509175483b cmd/golangorg: use embedded content on App Engine
Change-Id: If211bdb2ba60fbb799cb4dfe67fd066094afc40f
Reviewed-on: https://go-review.googlesource.com/c/website/+/343936
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-23 15:30:36 +00:00
Russ Cox a15e65e3f7 go.dev: move cmd/* to top level
This leaves only _content in go.dev.

Change-Id: I8b6e318f8d0c573479aafd09aa3e30f8177ed433
Reviewed-on: https://go-review.googlesource.com/c/website/+/342890
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-17 19:02:23 +00:00
Dmitri Shuralyov 91d80a5150 tour: use embed and io/fs
Embed content, static and template directories directly in the tour
binary. This way it will work even if the package source is deleted.
The content in those directories is not large, the binary size goes
up from 14.2 MB to 15.2 MB in my testing (with Go 1.17 darwin/arm64).

Start using the Go 1.16 runtime for App Engine deployment.

Updates golang/go#44243.

Change-Id: I35fb32961cdc1edec1f8f8c0fc0193b07cef9acd
Reviewed-on: https://go-review.googlesource.com/c/website/+/342711
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-08-17 16:12:32 +00:00
Alexander Rakoczy 8bf2ffb05d blog, tour, go.dev, golang.org: stop referencing mirror.gcr.io URLs
As per the documentation: Google Cloud services such as Cloud Build and
Google Kubernetes Engine automatically check for cached images before
attempting to pull an image from Docker Hub.

Also: Only obtain cached images on mirror.gcr.io by configuring the
Docker daemon. A request to pull directly from mirror.gcr.io will fail
if a cached copy of the image does not exist.

Source: https://cloud.google.com/container-registry/docs/pulling-cached-images

Change-Id: I4320f97b016d928ea7431c56dd7486467f436a53
Reviewed-on: https://go-review.googlesource.com/c/website/+/340171
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
2021-08-05 17:43:24 +00:00
Dmitri Shuralyov ea8c25a269 tour: look for content in x/website module
As of CL 323897, the tour command and its static content are
contained in a module with a slightly different module path.
Update findRoot accordingly so it looks in the right place.

Updates golang/go#44243.

Change-Id: I5c979789440464ca3f9f99799bcc8e73db0769a3
Reviewed-on: https://go-review.googlesource.com/c/website/+/334969
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-17 18:43:54 +00:00
Alberto Donizetti 02958007db tour: fix instructions to run locally
Since the golang/tour repository was emptied and the tour content
moved to x/website/tour, go-getting golang.org/x/tour no longer works.
This change updates the instructions to run the tour locally, both in
the tour welcome page and in the repository's README.

It also updates the pkg.go.dev badge link.

Fixes golang/tour#1203

Change-Id: I1591e790ff3821dea4304f38a7ebc7867da585a6
Reviewed-on: https://go-review.googlesource.com/c/website/+/326330
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-17 16:35:42 +00:00
Russ Cox 5f5f230b60 all: promote new app deployments only after they become ready
There are differences in the App Engine environment that
cannot be adequately simulated elsewhere. Although we do
the best we can with testing locally, there will always be
differences.

The old makefiles deployed the site, then ran a regression
test against it, and then promoted the tested version.

This change does the same. The testing has moved into the
web server proper so that it can test the handler directly and
thereby check things like the responses on different domains.

The go-app-deploy.sh now always deploys --no-promote,
only promoting after a self-test passes on the deployed site.

Unlike the old check which only applied to golang.org,
the new pre-promotion testing happens for all the sites.

Also factor out GoogleCN into internal/web, because we needed
to modify it (to avoid internal/webtest's requests being diagnosed
as coming from China) and there were too many copies.

Change-Id: I0cde0e2167df2332939908e716ddb6bf429f2565
Reviewed-on: https://go-review.googlesource.com/c/website/+/329250
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-23 19:06:38 +00:00
Russ Cox bfe83e6362 tour: fix for new app deployment
The app now runs in the root of the repo, so need to use "tour" not "." for tour root.

Fixes golang/go#46793.

Change-Id: I14499e0c662793789bc1a2603db9dd7c0e1011ad
Reviewed-on: https://go-review.googlesource.com/c/website/+/328675
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-16 22:45:28 +00:00
Russ Cox 64bfe057e6 tour: stop being a submodule
This brings tour in line with the other websites in this repo,
which will help smooth the eventual merge.

Change-Id: I54a0954d431fa511ac26992e580589fe1b87b030
Reviewed-on: https://go-review.googlesource.com/c/website/+/323897
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-06-16 18:38:47 +00:00
Alberto Donizetti 0ff9d971f1 tour: fix dead link to golang.org search
The methods/21 slide in the tour linked to

 golang.org/search?q=Read#Global

to list examples of the Reader interface implementations in the
standard library. The link has been dead since the search
functionality was removed from the golang.org website.

AFAIK the pkg.go.dev doesn't yet support symbol search, and I wasn't
able to find a way to replicate the old golang.org search result on
pkg.go.dev; this change replaces the link with a cs.opensource.google
search that shows very similar results to the ones from golang.org.

Fixes golang/tour#1140
Updates golang/tour#1144
Updates golang/tour#1158
Updates golang/tour#1168
Updates golang/tour#1169
Updates golang/tour#1173
Updates golang/tour#1174
Updates golang/tour#1175
Updates golang/tour#1178
Updates golang/tour#1206
Updates golang/tour#1207

Change-Id: I762f426cc84ee7b94a7a1147bf5a258f61d0acde
Reviewed-on: https://go-review.googlesource.com/c/website/+/326329
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-13 14:35:50 +00:00
Russ Cox 936bfe8ac7 blog, go.dev, tour: add cloudbuild deployment configs
These deployment configs are meant to be run from Cloud Build.
They deploy a new version of the site on each commit,
using the commit date and hash to derive the app version.
If a commit is submitted with a Website-Publish+1 vote,
then the new version is promoted to be the live version of the site.
Otherwise the new version is left unpromoted, where it can be
manually inspected and potentially manually promoted,
or simply ignored and eventually automatically deleted.

golang.org will work this way too, after we move it off of Flex.

Change-Id: Iaddb3596276d5cfbf18aa67f210fcd33f323d9d5
Reviewed-on: https://go-review.googlesource.com/c/website/+/324511
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
2021-06-03 14:59:40 +00:00
Russ Cox b593c133e4 tour: fix go.mod module path
The supporting packages (pic, reader, tree, wc) are still
in golang.org/x/tour, so delete these copies.

Fix the remaining references in local.go to use
golang.org/x/website/tour instead of golang.org/x/tour
to find the content files.

While we are here, make go test ./... considerably faster
by parallelizing TestContent.

For golang/go#46501.

Change-Id: Ia80161830f5f2f87fb6e39a0ee39c4b176fb425b
Reviewed-on: https://go-review.googlesource.com/c/website/+/324395
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-02 22:51:29 +00:00
Russ Cox 18525007e5 blog, go.dev, tour: update deployment instructions
Automatic deployment is now enabled for these web sites.
(But not yet for golang.org. Waiting on the pending CLs for
better testing.)

Change-Id: I19a690d6354f83601be355b1eb5ca8003efd911a
Reviewed-on: https://go-review.googlesource.com/c/website/+/324410
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-02 21:30:36 +00:00
Russ Cox ea4c663457 [x/tour] app.yaml: remove GOLANGORG_CHECK_COUNTRY
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>
X-Tour-Commit: 3891a3eb15c053bf644848461c84facbfe1cfb34
2021-05-26 03:10:51 +00:00
Russ Cox aedb798f51 [x/tour] all: go get golang.org/x/tools@a3eb095d6ae && go mod tidy
Bring in CL 293449 (and more) to remove /share playground proxy.

Change-Id: I761ddb0797e3032f79ac3fd91e3f5c4bd4307eda
Reviewed-on: https://go-review.googlesource.com/c/tour/+/296371
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>
X-Tour-Commit: fa9f4b9b72b09cbc55464f936d32179709b937cd
2021-05-26 03:10:49 +00:00
Alberto Donizetti 09389c1565 [x/tour] content: remove link to old video showing GOPATH workflow
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.

Fixes golang/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>
X-Tour-Commit: a278aee398d54cb9f07b7e8961ffcd5d88abfda5
2021-05-12 16:45:46 +00:00
Alberto Donizetti 610c92e7de [x/tour] content: use uniform dashes in translation links
Fixes golang/tour#1179

Change-Id: I080c12cad0a6a6d2e4bee9b5af1aa01cb90e4a5a
Reviewed-on: https://go-review.googlesource.com/c/tour/+/319309
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
X-Tour-Commit: 7c0634e83fce00e061c55c76d0003c9ed280918a
2021-05-12 16:14:47 +00:00
MStokluska 255e3c83f9 [x/tour] content: add link to Polish translation
Change-Id: I8afdf85924e8eeba179d23cc9f978d4236ab740e
GitHub-Last-Rev: 9ad40ae1da2fb486932e777b02db5cf57fc58320
GitHub-Pull-Request: golang/tour#1136
Reviewed-on: https://go-review.googlesource.com/c/tour/+/298150
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
X-Tour-Commit: e4a37d30d6fc8cd440803accaf188700f163438e
2021-03-29 14:42:03 +00:00
Alberto Donizetti f079b53cbe [x/tour] content: remove links to translations that are not online
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#41219
Fixes golang/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>
X-Tour-Commit: 0a3a62c5e5c0d05b1347b4156a5caa5b4e5758e3
2021-03-17 16:35:53 +00:00
Dmitri Shuralyov 87a94674c2 [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 <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
X-Tour-Commit: b3263fcf7749f3600c8928d5f7d4e8a66a34b74f
2021-03-05 16:09:21 +00:00
Dmitri Shuralyov 4089f7017c [x/tour] 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>
X-Tour-Commit: b72029adf3393d3635828fedcddd5ae7053d3250
2021-03-04 02:13:20 +00:00
Julie Qiu 599a4177e5 [x/tour] README.md: add badge to pkg.go.dev
Change-Id: Ifa508b83e5b02db6a3d5a173879fab17bdd4a50d
Reviewed-on: https://go-review.googlesource.com/c/tour/+/275196
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Julie Qiu <julie@golang.org>
X-Tour-Commit: 004403599411fcd726b1e58cd0199083507d2047
2020-12-07 21:45:21 +00:00
Dmitri Shuralyov 06cd1185ae [x/tour] tour: update to the App Engine Go 1.14 runtime
Reference:

•	https://cloud.google.com/appengine/docs/standard/go/runtime

Change-Id: I46b87098ed04c9c5d9f84193c9d72f9d30a59233
Reviewed-on: https://go-review.googlesource.com/c/tour/+/266818
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
X-Tour-Commit: 4bb7d986198daef2a80e976e7a3576204332e0ba
2020-11-06 23:45:42 +00:00
Dmitri Shuralyov ab3756d1dc [x/tour] tour: redirect HTTP traffic to HTTPS
Set secure to always on all handlers so that HTTP traffic
is redirected to an HTTPS URL with the same path.

References:

•	https://cloud.google.com/appengine/docs/standard/go/application-security#https_requestshttps://cloud.google.com/appengine/docs/standard/go/config/appref#handlers_secure

For golang/go#42281.

Change-Id: Ic03e01d5858e1e5b8ae1b523ab34d970e1403ce0
Reviewed-on: https://go-review.googlesource.com/c/tour/+/266817
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
X-Tour-Commit: 59417492f03e0d55e544815ff163973cef919f67
2020-11-06 23:45:32 +00:00
Alberto Donizetti 715d13b7ec [x/tour] content: link to working and updated korean translation
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#1026
Fixes golang/tour#709
Fixes golang/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>
X-Tour-Commit: 6f9d4ff994b136951d420708cd231da267653086
2020-10-07 07:14:57 +00:00
Dmitri Shuralyov b6aa4feeaa [x/tour] pic: don't make a string copy when writing image
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>
X-Tour-Commit: 0608babe047def227de553b6538ed3bd6277acff
2020-05-08 15:55:40 +00:00
Dmitri Shuralyov 0f95301601 [x/tour] pic: add a test
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>
X-Tour-Commit: 6a4383abac21758536e477d3eed0a63ba560173c
2020-05-08 15:55:20 +00:00
Dmitri Shuralyov cc41fcfd8c [x/tour] pic: document package
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>
X-Tour-Commit: 8ec2108c3ab568fa335edadc5cd9a2c5ab5361ec
2020-05-08 15:55:07 +00:00
Alberto Donizetti 121ae4d1cc [x/tour] README: clarify where tour issues should be reported
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.

Fixes golang/go#36843

Change-Id: I7844ea1a15470fdfbc970a9485d37250a6c38779
Reviewed-on: https://go-review.googlesource.com/c/tour/+/217357
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
X-Tour-Commit: 8f38c9a8d074c1943ede6463d78b0d769331dd3e
2020-02-01 21:26:31 +00:00
Andrei Enshin 86e44499e7 [x/tour] content: use singular "interface" when discussing Reader
Change-Id: I830a3bf4cfffe96f90c68e725d3806114543f360
GitHub-Last-Rev: dcefcf469c789f262d8452f6a642aa31d235f172
GitHub-Pull-Request: golang/tour#878
Reviewed-on: https://go-review.googlesource.com/c/tour/+/212817
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
X-Tour-Commit: 2bf82070c397a994c62dff00045443d18b37d807
2020-01-06 16:25:11 +00:00
Martin Kunc 5342e5140c [x/tour] tour: update README after App Engine runtime change
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: b3facf0d8dd5ceccea4c2260b5fab4f6f731e827
GitHub-Pull-Request: golang/tour#880
Reviewed-on: https://go-review.googlesource.com/c/tour/+/212999
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
X-Tour-Commit: 59af52b46224c65cf71b551cca89922747a86e61
2020-01-06 16:17:50 +00:00
Ibrahim AshShohail 6b59efdc8f [x/tour] content: add Arabic to the list of available languages
Add Arabic to the list of languages available.

Change-Id: I61f7dffc92cb70f9c436ac7b3ff6243d3c695e44
GitHub-Last-Rev: 3574b0b84e9e0236833518840f393bb817a1e1ca
GitHub-Pull-Request: golang/tour#862
Reviewed-on: https://go-review.googlesource.com/c/tour/+/209958
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
X-Tour-Commit: 3765179383a5cd54eed800c62cc4b9de24fbce0b
2019-12-06 15:32:53 +00:00
Evan Jones d823e5336f [x/tour] tour: Rename mux -> mu to follow convention
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: 31ef869d9b72e7eb08b9be9340242b0e535a175f
GitHub-Pull-Request: golang/tour#813
Reviewed-on: https://go-review.googlesource.com/c/tour/+/192725
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
X-Tour-Commit: 2e616b842c1127f0f4f1e49fcf2765d347bcaea1
2019-12-04 02:50:12 +00:00
Dmitri Shuralyov 399ec82014 [x/tour] tour: add analytics HTML and deploy instructions
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>
X-Tour-Commit: 6bb846ce41cdca087b14c8e3560a679691c424b6
2019-10-02 17:10:47 +00:00
Dmitri Shuralyov 97ae36a7ed [x/tour] content: make welcome/3 slide more beginner friendly
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.

Fixes golang/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>
X-Tour-Commit: 45121acd746573507cdaaf902958dba082f7c25b
2019-10-01 16:34:06 +00:00
Bryan C. Mills 212460b258 [x/tour] content: skip test if the 'go' command is missing
Change-Id: I52c906fc33b1e94c64419cbf574f15d67ce90e39
Reviewed-on: https://go-review.googlesource.com/c/tour/+/192328
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
X-Tour-Commit: 3c9f1af8b2da3b3661a39ee550190917c0cf5208
2019-08-29 16:58:21 +00:00
Alberto Donizetti 9d9117c480 [x/tour] tour: btrees do not store values just in leaves
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.

Fixes golang/tour#774

Change-Id: I71af71ccf36ac8ad87dfe73b751b461890c3a7e0
Reviewed-on: https://go-review.googlesource.com/c/tour/+/179937
Reviewed-by: Andrew Bonventre <andybons@golang.org>
X-Tour-Commit: 1f1f3d2b450bb9b46a281dc119148605afd67c6d
2019-06-11 16:45:51 +00:00
Dmitri Shuralyov b2289c5855 [x/tour] tour: make space optional after "#appengine:" prefix
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>
X-Tour-Commit: db40fe78fefcfdeefb4ac4a94c72cfb20f40ee77
2019-03-18 02:04:41 +00:00
Andrew Gerrand c54c2c7095 [x/tour] content: fix formatting on appengine-specific slides
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>
X-Tour-Commit: 7de0bd1d74c6d868b2007ca43ea240671a6618f1
2019-03-13 21:19:59 +00:00
Bryan C. Mills f64c3ba517 [x/tour] all: add go.mod
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>
X-Tour-Commit: eb9b2d835a38ce2950a79199305257e7c659e4de
2019-03-12 21:31:00 +00:00
Dmitri Shuralyov 7316623381 [x/tour] tour: deploy with App Engine Standard on Go 1.11
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>
X-Tour-Commit: 45a20b0d69ef2b06d2edfd97210a0df9ffd7f829
2019-03-07 18:39:40 +00:00
Wenzel Lowe c458b54065 [x/tour] tour: update Spanish tour link
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: ce817cb3e1d7f4b1a30c9f0f43f5abed5555affc
GitHub-Pull-Request: golang/tour#687
Reviewed-on: https://go-review.googlesource.com/c/158918
Reviewed-by: Andrew Bonventre <andybons@golang.org>
X-Tour-Commit: 838ce51196a7e9f9bff83402caf4f678dc0f0d75
2019-02-06 17:16:15 +00:00
B.G.Adrian 20c9b0c5af [x/tour] content: clarify semantics of range clause
Fixes golang/tour#560

Change-Id: I91255fe7ddb6df16268d6adc6afa2a502f1265f0
Reviewed-on: https://go-review.googlesource.com/c/125055
Reviewed-by: Andrew Bonventre <andybons@golang.org>
X-Tour-Commit: 0b2cf7c0845f35c40cf2d699f801671149e9e2cb
2019-01-30 19:17:23 +00:00
Katie Hockman 5b5c46d4bb [x/tour] tour: update README to more closely match the blog
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>
X-Tour-Commit: df79fa323b803b074d1d58bef988babd261b04bd
2018-11-09 18:51:21 +00:00
Alberto Donizetti 3bfd518bdb [x/tour] content: add newline to Printf call in flowcontrol
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.

Fixes golang/tour#642

Change-Id: I24d048e96620cbdaa668644e1460749cbea66ac5
Reviewed-on: https://go-review.googlesource.com/c/148617
Reviewed-by: Ian Lance Taylor <iant@golang.org>
X-Tour-Commit: cc618b7871d4aba6474c796954f8fc07aef01a82
2018-11-09 17:14:26 +00:00
Katie Hockman bee86fdf85 [x/tour] tour: update to new favicon.ico
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>
X-Tour-Commit: 16d3ff4aeb4f07df3cbc2d072b04443a462b2f69
2018-11-07 18:15:31 +00:00