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.
Fixesgolang/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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
"-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>
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>
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.
Fixesgolang/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>
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>
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>
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>
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>
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>
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>
The app now runs in the root of the repo, so need to use "tour" not "." for tour root.
Fixesgolang/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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>