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

1838 Коммитов

Автор SHA1 Сообщение Дата
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
Bryan C. Mills 7588ddd3e9 _content/ref/mod: mention other Go 1.17 behaviors that depend on the go version
Updates golang/go#36876
Updates golang/go#42970
Updates golang/go#45965

Change-Id: I542e9ece986806f9b4a062f242387b1ca47f5814
Reviewed-on: https://go-review.googlesource.com/c/website/+/335050
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-07-16 21:09:52 +00:00
Bryan C. Mills fa093afd72 _content/ref/mod: document Go 1.17 lazy loading and module graph pruning
For golang/go#36460

Change-Id: I36b3657103f069412b225356d011a19c1a10109e
Reviewed-on: https://go-review.googlesource.com/c/website/+/333629
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
2021-07-16 21:09:22 +00:00
Frederik Zipp 11adafea15 _content/doc: remove duplicated "does not"
Change-Id: I8930b2e394c30334b99bb3e169e805f2025ec7d9
Reviewed-on: https://go-review.googlesource.com/c/website/+/324709
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
2021-07-15 15:49:25 +00:00
Bryan C. Mills 3cb80103cf _content/doc/modules/pruning: add a placeholder redirecting to “Managing dependencies”
I plan to add a more in-depth troubleshooting guide at this URL.
For now, I just need to URL to work so that I can point to it in
the 'go' command in Go 1.17 (in CL 332573).

For golang/go#36460

Change-Id: I95f03f76519dfb196ed6c9c13003b2ad9becf6c9
Reviewed-on: https://go-review.googlesource.com/c/website/+/334389
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Steve Traut <straut@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-07-13 21:58:40 +00:00
Dmitri Shuralyov 8557135a89 internal/history: document Go 1.16.6 and Go 1.15.14
Change-Id: I2a585536147bd030f1bb333c05ffa45ef656bfcc
Reviewed-on: https://go-review.googlesource.com/c/website/+/334069
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>
2021-07-12 22:28:50 +00:00
Russ Cox 29745a29f8 cmd/golangorg: fix, restore tip.golang.org tests
The golang.org health check was failing the tip.golang.org tests
because the host enforcer was redirecting an unknown subdomain
to golang.org. Make tip a known subdomain to fix the tests, and
then restore them.

(The standard tip.golang.org setup disables the enforcer instead.)

Change-Id: Id15e7bcb3a704b7782e132c4303576f9d3e80cb0
Reviewed-on: https://go-review.googlesource.com/c/website/+/334112
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
2021-07-12 20:02:05 +00:00
Russ Cox e8cce616b8 cmd/golangorg: fix test case for tip
The tip code hasn't landed yet, this snuck in early.

Change-Id: I6ca1dcd5cca403456dc8e13e5a2821b553619f50
Reviewed-on: https://go-review.googlesource.com/c/website/+/334110
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-07-12 19:14:20 +00:00
Russ Cox aa5eb5fcb4 internal/web: redirect golang.org/pkg/... to pkg.go.dev/...
This reduces the number of documentation sites we have to one.
Except in China, where we have to keep serving on the one domain
golang.google.cn - there is no pkg.go.dev in China.
And unless people opt out with ?m=old.

For golang/go#44356.

Change-Id: I2a5b788ac861ce37f356287413468497d184fc09
Reviewed-on: https://go-review.googlesource.com/c/website/+/327849
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-12 19:03:25 +00:00
Steve Traut f481c2bd18 _content/doc: fix a broken link to Querying topic
This change fixes a link from /doc/database/change-data
to /doc/database/querying.

Change-Id: I76b57d0df17b4ef65dc02afd0a1f33aeef262243
Reviewed-on: https://go-review.googlesource.com/c/website/+/332251
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Steve Traut <straut@google.com>
2021-07-12 15:12:58 +00:00
Steve Traut a46b181d9b _content/doc: add a Go/Gin web service tutorial
This adds a tutorial introducing how to build a RESTful web service
using Go and the Gin web framework.

This change includes:

- A RESTful web service tutorial:
  - _content/doc/tutorial/web-service-gin.md

- Updates to index topics so that they list the new content.
  - _content/doc/index.html
  - _content/doc/tutorial/index.html

Change-Id: I137dcd884c4e38b4a2bebd733ec630f2d9bc3b95
Reviewed-on: https://go-review.googlesource.com/c/website/+/332349
Trust: Steve Traut <straut@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2021-07-12 15:00:05 +00:00
Jay Conrod aee54c06b6 _content/ref: add table of supported version control systems
Change-Id: Id83f3e7deac143abb1db7272090daafad89acab9
Reviewed-on: https://go-review.googlesource.com/c/website/+/324489
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-07-08 21:22:47 +00:00
Steve Traut d6de7f00de _content/doc: add data access tutorial and guide
This adds an introductory tutorial on accessing relational
databases, as well as a deeper dive data access guide
comprising nine topics.

This change includes:

- A data access tutorial:
  - _content/doc/tutorial/database-access.md -- An introductory
    data access tutorial.

- A data access guide:
  - _content/doc/database/index.md -- An overview of data
    access with Go.
  - _content/doc/database/open-handle -- On opening a database handle.
  - _content/doc/database/change-data -- On executing SQL statements
    that don't return data
  - _content/doc/database/querying -- On querying for data
  - _content/doc/database/prepared-statements -- On using prepared
    statements
  - _content/doc/database/execute-transactions -- On executing
    transactions
  - _content/doc/database/cancel-operations -- On using Context to
    support cancelling in-progress database operations
  - _content/doc/database/manage-connections -- On customizing the
    connection pool and using a reserved connection
  - _content/doc/database/sql-injection -- On using function
    parameters to avoid a SQL injection risk

- Updates to index topics so that they list the new content.
  - _content/doc/index.html
  - _content/doc/tutorial/index.html

Change-Id: Iab94d93e5d53e1379b22098c08d517b99cfa2c27
Reviewed-on: https://go-review.googlesource.com/c/website/+/331449
Reviewed-by: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Steve Traut <straut@google.com>
2021-07-01 14:24:37 +00:00
Than McIntosh 6a50fde3fa internal/dl: add thanm to validUser
Change-Id: Ic87f3bf158b573a9773e999d79860fba58f2a92c
Reviewed-on: https://go-review.googlesource.com/c/website/+/332069
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-01 13:29:39 +00:00
Bryan C. Mills 63a720e45b _content/ref/mod: clarify that go.mod files are not required for dependencies
We already mentioned this fact elsewhere in the document, but the
"go.mod files" section is a likely starting point for someone trying
to figure out what happens when the file is missing. This adds some
prose and links there to point the reader to the appropriate sections.

Noticed via https://stackoverflow.com/q/67030123.

Change-Id: Ia7fe50a8b97b8cc1320778c318e5b3b0694d7c05
Reviewed-on: https://go-review.googlesource.com/c/website/+/331949
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-06-30 18:47:03 +00:00
Bryan C. Mills f5efdd8478 _content/doc/modules: add missing space in link text
Change-Id: Iecd4a489c730563abf13dcf5990e8361a89d4edd
Reviewed-on: https://go-review.googlesource.com/c/website/+/331549
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-06-30 15:08:38 +00:00
Russ Cox a430a3f526 internal/web: pre-expand tabs in markdown
Goldmark has a bug that causes crashes in inputs
containing mixed spaces and tabs. Avoid it by removing tabs.

Change-Id: I4c678fce6c68bf0d448ed0b75a2ac12a42891ec6
Reviewed-on: https://go-review.googlesource.com/c/website/+/331349
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Steve Traut <straut@google.com>
2021-06-28 13:50:53 +00:00
Russ Cox f5f2b7d2bc blog/stackoverflow: add Go Collective link earlier
Change-Id: I7124a778631f24f50a9472db43684d09ffa3508c
Reviewed-on: https://go-review.googlesource.com/c/website/+/330730
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Steve Francia <spf@golang.org>
2021-06-24 20:48:17 +00:00
Russ Cox 2c48e862e9 go.dev: add five new blog posts to solutions page
- Allegro
- Monzo
- SIXT
- Stream
- Trivago

Change-Id: Ife0ea0051cf9ed0357175fb21ed18b96cda918d8
Reviewed-on: https://go-review.googlesource.com/c/website/+/330729
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Steve Francia <spf@golang.org>
2021-06-24 20:48:15 +00:00
Russ Cox 5d3d845a1c blog/_content: add stackoverflow.article
Change-Id: I0b0e4478cb111bd8b3828707eb82cd488a2bf8be
Reviewed-on: https://go-review.googlesource.com/c/website/+/330449
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Steve Francia <spf@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
2021-06-23 20:17:50 +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 d38c22d04f cmd/golangorg: expose multiple domains on testing servers
We already have one server handling multiple domains:
golang.org and golang.google.cn. As we make the server
handle more domains it is helpful to be able to get at each
of them in the testing server.

This CL changes the behavior on localhost or on an appspot.com domain
to pull the effective host name out of the first element of the path.
It also rewrites HTML responses to turn relative links like /doc to /<host>/doc
and to turn absolute links like https://golang.org/doc into /golang.org/doc.

Change-Id: I032b626f1c75deed61a9ae2d9562d6b177b2824a
Reviewed-on: https://go-review.googlesource.com/c/website/+/328013
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>
2021-06-23 18:38:55 +00:00
Heschi Kreinick d52a65716c _content/doc: fix go mod edit for PowerShell
"-replace=foo.com=bar.com" triggers this bug in PowerShell:
https://github.com/PowerShell/PowerShell/issues/6291
The go command accepts "-replace foo.com=bar.com" just fine. Use that
instead.

Fixes #44924.

Change-Id: I854ea86282db425a2707c641b0500208b4869870
Reviewed-on: https://go-review.googlesource.com/c/website/+/330229
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Steve Traut <straut@google.com>
2021-06-23 15:10:42 +00:00
Tobias Klauser 050e222eac _content/doc/modules: add missing @ in replace command
Change-Id: I96f1559e42a46eba327795d953b45eebd034af0e
Reviewed-on: https://go-review.googlesource.com/c/website/+/330049
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-06-22 16:20:43 +00:00
Jay Conrod 08e38f9b82 _content/ref: add extra note for 'go get' build deprecation
For golang/go#43684

Change-Id: Ic72fd0b6d1f4ff3262115e1cdaf028c315dc18f8
Reviewed-on: https://go-review.googlesource.com/c/website/+/329500
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-06-21 15:36:43 +00:00
Eno Compton 166cd2c7a7 blog: fix broken link
Change-Id: Ia4e81679eb988c6c10f754e6eac9a5ad7b5ada74
Reviewed-on: https://go-review.googlesource.com/c/website/+/329496
Reviewed-by: Jay Conrod <jayconrod@google.com>
Trust: Tyler Bui-Palsulich <tbp@google.com>
2021-06-21 15:25:17 +00:00
Russ Cox 06fdb770f7 cmd/golangorg: make zip contents seekable
https://golang.org/misc/cgo/stdio/testdata/fib.go fails right now
because the http.FileServer wants to use Seek to find out the file size.
Make that work by introducing an FS wrapper that enables seeking
in an in-memory copy of the file content.

Fixes golang/go#46809.

Change-Id: I353905310dc74594e54e0181dc821a97992b8da7
Reviewed-on: https://go-review.googlesource.com/c/website/+/329249
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Russ Cox <rsc@golang.org>
2021-06-18 01:31:37 +00:00
Russ Cox a2b5f4911c cmd/golangorg: find contentDir even on App Engine
After the refactoring we use this now instead of repoRoot
in the call to NewHandler.

Once we have Go 1.16 this will all be simplified using //go:embed.

Also delete comment that I deleted locally in the previous CL
but then didn't upload before clicking Submit on the Gerrit web page.

Change-Id: Id6e122d39914c1059e97af6cd7e90049142dbe7f
Reviewed-on: https://go-review.googlesource.com/c/website/+/329010
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>
2021-06-18 01:30:32 +00:00
Russ Cox 30658dff6b cmd/golangorg: factor out main handler setup
Also avoid use of http.DefaultServeMux entirely, for clarity about what is registered.

Change-Id: Ibd7ccd7a6c3cb6b79e94b77570ad016a1be11f0c
Reviewed-on: https://go-review.googlesource.com/c/website/+/328012
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-17 16:55:37 +00:00
Russ Cox 7e9c28a76a cmd/golangorg: merge into single source file
There is so little left here that the file
boundaries make no sense anymore.
Move all the functions into main.go.
registerHandlers was inlined instead of
copied.

Change-Id: If91a5d1dc75834747b9d803ec44790950d503aed
Reviewed-on: https://go-review.googlesource.com/c/website/+/328011
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-17 16:18:35 +00:00
Russ Cox fdd9055814 cmd/golangorg: deduplicate testdata/live.txt and testdata/web.txt
These are duplicates for no particularly good reason anymore.
Move the general tests into testdata/web.txt, leaving in live.txt
only the tests that cannot work except in production.

Change-Id: Ia8b4271a9cce78814ac57c7b4a462383e77ee3d5
Reviewed-on: https://go-review.googlesource.com/c/website/+/328010
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-17 16:18:31 +00:00
Russ Cox 99fa69ef01 cmd/golangorg: remove global fsys, site
Also clean up hostEnforcerHandler doc comment while we are here.

Change-Id: I2db17d8146eaba95c887e1439320e30e9c8fc769
Reviewed-on: https://go-review.googlesource.com/c/website/+/328009
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>
2021-06-17 16:18:27 +00:00
Russ Cox 34c35d982b go.dev: fix for new app deployment
Same problem as tour: now running in the repo root.

Change-Id: I5227b5c0d1d161e2af702e5d37979be000407813
Reviewed-on: https://go-review.googlesource.com/c/website/+/328211
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>
2021-06-17 16:10:07 +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 f3510d6865 go.dev: make cloudbuild.yaml safe to run in golang-org project
Setting --project=go-discovery on the command lines is enough
to do the deploy directly from golang-org Cloud Build, avoiding
an inline cloudbuild.yaml in the trigger configuration that was
reinvoking the cloud build in the other project.

(I gave the golang-org cloud build account permission to be an
"App Engine Deployer" for go-discovery.)

Change-Id: Iafed260f96b9adcf7442a9fa0df2cc44ea28a2ea
Reviewed-on: https://go-review.googlesource.com/c/website/+/328690
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-06-16 22:44:00 +00:00
Russ Cox 73dd377356 cmd/googlegolangorg: make google.golang.org a separate service
The version cleaner deleted the very old version of golang.org
named "google", as it was designed to do. Make google.golang.org
its own service instead of a precarious version.

Already deployed, to bring back google.golang.org.

Change-Id: Ia3e63a93d8b613e9cc7f7d241d9187d9422cf6ba
Reviewed-on: https://go-review.googlesource.com/c/website/+/328689
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-16 18:39: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
Russ Cox c725e44129 go.dev: clean up deployment
Delete separate learn service files, since the service has been deleted.
(learn.go.dev is now served by the same service as go.dev.)

Also make the yaml commands a bit more readable.

Change-Id: I8c453cb38bef84eb1d795e949c9bc315360c0deb
Reviewed-on: https://go-review.googlesource.com/c/website/+/323896
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-06-16 18:38:43 +00:00
Russ Cox 7fe5e1bf67 blog: simplify app, stop being a submodule
This app has a lot of history. App Engine used to require different code
for local execution and running on App Engine, because the latter supplied
func main. No longer. Unify all the code into a simpler single file.

Also use the new x/website. (The old go.mod was pinning an older
x/website from before we adopted fs.FS. Now that we have a backported
io/fs, we can use the new x/website, which is what lets us get rid of
the submodule boundary.)

This brings blog in line with the other websites in this repo,
which will help smooth the eventual merge.

Change-Id: Ibe95674ac6765c15bb82a82dc52845a2377cebf7
Reviewed-on: https://go-review.googlesource.com/c/website/+/323894
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-06-16 18:38:38 +00:00
Russ Cox 96b571dae1 go.dev: stop being a submodule
Now that x/website is Go 1.15-safe,
we can make go.dev a plain subdirectory
and use x/website's copy of the template packages
instead of the go.dev copy.

Change-Id: I55a1c3d47b6a96cedfd6eab260533d4e4b28ea88
Reviewed-on: https://go-review.googlesource.com/c/website/+/323893
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-06-16 18:38:33 +00:00
Russ Cox e0d934b436 cmd/golangorg: simplify, run on App Engine Standard, not Flex
This app has been through a lot of evolution and has accumulated
a lot of cruft in the way it is deployed. We can simplify deployment
down to a short Cloud Build script and go back to regular App Engine
for execution.

Also remove the prod-vs-local distinction and the build tag complexity.

App Engine Flex doesn't let us have extant versions without at least
a couple dedicated VMs, and then it also imposes a limit of 20 VMs,
which makes it unsuitable for continuous deployment, where we can
rack up many versions in a short amount of time. Going back to
App Engine Standard is a better fit, since versions that aren't getting
traffic scale down to zero.

Using App Engine Standard also matches blog and go.dev,
which will help with the eventual merging of all these servers.

Change-Id: I35167b569327ad253b9d367d747072a269205b20
Reviewed-on: https://go-review.googlesource.com/c/website/+/323892
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-16 18:19:59 +00:00
Filippo Valsorda 91e4906415 doc/go1.14: add missing release note about text/template escaping
Change-Id: If8b066124cb46a0e2a87eaf0271ee46221f02a3d
Reviewed-on: https://go-review.googlesource.com/c/website/+/328129
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-15 16:55:40 +00:00
Russ Cox d831351689 all: make compatible with Go 1.15
With the help of the backported libraries introduced in the previous CL,
we can make the whole cmd/golangorg site run on Go 1.15 again.
This will let us use App Engine standard in advance of the release
of Go 1.16 on App Engine.

Change-Id: I9d1612de6f366e0774919aa6a94af14aafb248f5
Reviewed-on: https://go-review.googlesource.com/c/website/+/323891
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>
2021-06-15 02:35:50 +00:00
Russ Cox 35beb4cf86 internal/backport: add backports of current Go dev template, fs packages
This will let us use these APIs on App Engine before Go 1.16 is available.
The only thing we can't backport from Go 1.16 is embed, so that has to
be build-tagged off still, but we don't really need embed on App Engine.

This will let us move golang.org off App Engine Flex onto regular App Engine,
which will greatly simplify deployment and make it possible to do automatic
deployments.

When App Engine adds Go 1.16 support, most of this can go away.
(The template packages will need to stay, as go.dev will need some
Go 1.17 bug fixes from them.)

Change-Id: I16ee64862a43f591a31fae04caf4caa0fdb5af62
Reviewed-on: https://go-review.googlesource.com/c/website/+/323890
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>
2021-06-15 02:35:47 +00:00
Russ Cox fb64aa77f9 cmd/golangorg: change tests to use internal/webtest
Much shorter and clearer.
This also opens up the possibility of sharing
some tests between TestWeb and TestLiveServer.

Change-Id: Iaca004c88581b0e0d8c858333806f755cc140255
Reviewed-on: https://go-review.googlesource.com/c/website/+/321075
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>
Website-Publish: Russ Cox <rsc@golang.org>
2021-06-15 02:12:41 +00:00
Russ Cox e5882a3721 internal/webtest: add package for testing web servers
This package provides a way to write simple script-based tests of
web server behaviors, instead of reinventing the logic in every test,
as we too often do.

See the doc comment in webtest.go for more details.

Change-Id: Ie1af4f1def488a7520dce46c242643aec15a2fcf
Reviewed-on: https://go-review.googlesource.com/c/website/+/321074
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>
2021-06-15 02:12:39 +00:00
Russ Cox de60b61b0e cmd/golangorg: split out internal/codewalk [generated]
This code is not likely to ever change, so it's nice to stash elsewhere.

CL generated by the script below.

[git-generate]
cd cmd/golangorg
rf '
	mv codewalk.go golang.org/x/website/internal/codewalk
'
cd ../../internal/codewalk
rf '
	mv CodewalkServer Server
	mv NewCodewalkServer NewServer
	mv Codewalk codewalk
	mv Codestep codestep
'

Change-Id: If16a7dc9214a8d44ce42bc8e7e6ccd502b718c0e
Reviewed-on: https://go-review.googlesource.com/c/website/+/317661
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-14 17:41:40 +00:00
Russ Cox 5d72b68448 cmd/golangorg: introduce CodewalkServer
Preparation for moving to a new package.

Change-Id: Ib246f694f950eadcb9afa78e6551c8fb22e109a8
Reviewed-on: https://go-review.googlesource.com/c/website/+/317660
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:39 +00:00
Russ Cox 5ee419f2ea all: remove toFS usage
The toFS calls were a stop-gap to convert from old code that wasn't
strict about path forms to the io/fs routines that are more strict.

Arrange to pass io/fs-compatible paths everywhere and remove toFS.

Change-Id: Id69c0f23074ebd3a6dfef2255b2f8185ad1d1249
Reviewed-on: https://go-review.googlesource.com/c/website/+/317659
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:38 +00:00
Russ Cox 4b5486d0e5 internal/dl: move template to lib/godoc
This completes an old TODO and uses the standard site frame
for the download page instead of having a separate copy.

Change-Id: Id647a6bb03d563b007b16cab51f40083d071c944
Reviewed-on: https://go-review.googlesource.com/c/website/+/317658
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:36 +00:00