These releases have been pre-announced to include a PRIVATE security fix:
https://groups.google.com/g/golang-announce/c/vtbMjE04kPk/m/xE-FGxCXCAAJ.
The fix summary is intentionally left blank until the day of the release,
other than to mention that the issue affects the standard library as the
Go security policy permits disclosing.
In the future, the go.dev website can be improved to display this
information automatically so that it doesn't involve a manual CL.
The motivation for this change was to investigate that the recent
FixSummary type and template are flexible enough to support that.
Change-Id: I340e3b44440cecdb9b25c426f97cd8ff31c60acd
Reviewed-on: https://go-review.googlesource.com/c/website/+/398214
Trust: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Invoke the template named "html" using the usual html/template way
instead of invoking it as a function (via the tmplfunc package) to
work around https://github.com/rsc/tmplfunc/issues/1.
The package golang.org/x/tools/present imports "html/template" from
the standard library, so its HTML.HTML field of type template.HTML
isn't understood to be content from a trusted source by the internal
backported copy. Use type aliases for those special types to fix that.
Fixesgolang/go#51989.
Updates rsc/tmplfunc#1.
Change-Id: Ib9609f41b17407e297ea3bb111f346188aa7a9b0
Reviewed-on: https://go-review.googlesource.com/c/website/+/396234
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com>
Make it possible to use the higher-level fix summary fields, instead of
CustomSummary, when a release has both bug fixes and security fixes.
Rewrite the recent hand-written custom summaries to use the new fields,
which produces equivalent output that differs largely in white-space
and some trivial consistency fixes.
Fixesgolang/go#51719.
Updates golang/go#38488.
Updates golang/go#44918.
Change-Id: I672cea21f63cb4ab9764efb6cbc783cf503b791c
Reviewed-on: https://go-review.googlesource.com/c/website/+/393357
Trust: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <amedee@google.com>
This will let us have "Go 1.17" in the dropdown on go.dev/play.
And when the next release happens and goprevplay and play are
updated, the versions will update automatically in the UI.
Change-Id: Id76f89767c3a91a2c9e27c9fbdad5d6fd9674ab2
Reviewed-on: https://go-review.googlesource.com/c/website/+/393840
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
The immediate need was go/build, because the Go 1.16 go/build rejects
code that has //go:build without // +build, as Go 1.18 code now does.
But displaying code using generics would also have failed, for inability
to parse that code. Add the full go/ast, go/doc, go/format, go/parser,
go/printer, go/scanner, and go/token to fix those failures, which
would become more frequent as generics are used more inside the
standard library.
The code is all from the go1.18 tag of the Go repo, post-processed to
rewrite imports and apply gofmt -w -r 'any -> interface{}' to keep it
building with the other backports and with Go 1.16 syntax.
For golang/go#51686.
Change-Id: I1e14f4634d8bc09bdaa04c014eadb1be97ea5047
Reviewed-on: https://go-review.googlesource.com/c/website/+/393194
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
URL fragments are dropped from request targets. Stripping
the fragment from the URL ensures we capture the response
status.
Change-Id: I66ed67a23878315076762e4f99332613a4f67723
Reviewed-on: https://go-review.googlesource.com/c/website/+/385201
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Requests to URLs are expected to return HTTP Status 200.
To override the expected status code, testcases can use
the status keyword.
Change-Id: Ibe6696fc2fe2a779755ff96dc8c5532c1ce03c66
Reviewed-on: https://go-review.googlesource.com/c/website/+/384840
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
The original motivation to add hostnames to the files
was to make them easier to identify. Now that the origins
can be dynamically set with template variables, it causes
more trouble than it helps.
After removing the extensions, we can support reusing a
single test script for multiple origins. For example:
compare {{.Origin}}::cache {{.Origin}}
Origin may be set to https://staging-pkg.go.dev or
http://localhost:8080 and share the same set of screenshots.
Change-Id: I2c1811fcb0fa7cca9e3b5feeb362528fd3f07af4
Reviewed-on: https://go-review.googlesource.com/c/website/+/382157
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Scripts can use the block keyword to set URL patterns to block.
Wildcards ('*') are allowed.
While loading a webpage if chrome attempts to load a resource
from a blocked URL the request will fail. This is useful for
blocking things like dynamic badge images from a code coverage
or build indicator service.
Change-Id: Ifbde82d56918928333836b493e993c1ef1054a76
Reviewed-on: https://go-review.googlesource.com/c/website/+/381335
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Run-TryBot: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
When include=all is used, archived versions (old) and unstable versions
(new) are appended to the list of returned versions. This makes the
order of the list rather awkward: current, old, new. This commit makes
the ordering a bit more natural: new, current, old. However, even like
that, releases will be out of order, because, for example, 1.18rc1 is
new, while 1.17.6 is current, but 1.18beta1 is old. So, this commit
takes care to sort the entire list properly to avoid that. This way, the
entire list is sorted by version. Nothing changes semantically, as users
of the API can still filter out unstable releases using the "stable:
true" field.
This commit also adds a test case, to make sure this behavior doesn't
regress.
Fixesgolang/go#50201.
Fixesgolang/go#47367.
Change-Id: Ic136197dcdd47aa149601b75ba5152a2006c790a
Reviewed-on: https://go-review.googlesource.com/c/website/+/371934
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Jason Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Added a stylesheet insertion step that reduces
motion on web pages by speeding up animations
and removing animation delays.
Change-Id: If945f764dfafaebfedce87fa462c5824033808e2
Reviewed-on: https://go-review.googlesource.com/c/website/+/379134
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
The screenshot file extensions are updated such that
when the hostname of the origins for a testcase are
equal, for example when comparing cached screenshots
to live screenshots from the same server, the output
filenames do not collide.
Change-Id: I0b82f94d87912923e734fc30ba457a440ede94f4
Reviewed-on: https://go-review.googlesource.com/c/website/+/378476
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
To have test runs output consistent screenshots across
different systems we allow for the use of a remote
instance of Chrome by providing a url to its debugger
as a flag. For example:
go run ./cmd/screentest -d ws://localhost:9222
This is useful in a CI/CD environment to control the
chrome version and OS in which screenshots are taken.
Change-Id: I09b2e2d8e3056d7229808a57653d641677fc8cc3
Reviewed-on: https://go-review.googlesource.com/c/website/+/378475
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Testcases for screentest will run concurrently
with a configurable max concurrency setting that
defaults to half of number of CPUs on a system.
Change-Id: I07e7ffd8d3867c47b709c160110a58ac60ee357c
Reviewed-on: https://go-review.googlesource.com/c/website/+/377256
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Previously, obsolete screenshots would only be
cleared if the cache was enabled. This change
ensures all obsolete screenshots are deleted
prior to running tests.
Change-Id: If37caf92446f2174ef293177e9924f61a167cb81
Reviewed-on: https://go-review.googlesource.com/c/website/+/377255
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Screentest is updated to log test output to a buffer
in preparation for a future CL that will allow for the
parallelization of testcases.
Change-Id: I7e2681cc89bce631552996990fb4ffb390218c8b
Reviewed-on: https://go-review.googlesource.com/c/website/+/377254
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
To transform .ts files from any path on a site and to ensure
it works for all domains the transform logic is moved to the
web package.
Change-Id: I1ce62eb35dbdfb987ccc2f48e79c558bcdadfbbe
Reviewed-on: https://go-review.googlesource.com/c/website/+/374994
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Every day around 3:30pm US Eastern time
the web server seems to get overloaded.
It starts with a suspicious number of 500 responses
from /_/compile relaying to the default back end,
which start timing out after 10 seconds and then
grow longer and longer.
One theory is that the requests are lasting longer
than that and piling up in the system, since we are
using http.DefaultClient, which has no timeout.
Use a client with a 20s timeout to try to clear things
out a bit more promptly.
Change-Id: I7e1659adfcf63d6b712ede4d0fc2b508b3e6bb45
Reviewed-on: https://go-review.googlesource.com/c/website/+/375614
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Output directories and storage buckets are cleared of
obsolete files and diff results at the start of a test
run.
Change-Id: I96223314641d6958b91e0ec8d69550b3df295949
Reviewed-on: https://go-review.googlesource.com/c/website/+/374774
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Test scripts parse output locations that begin with gs://
as Cloud Storage buckets. When a bucket is used diff
images and cached screenshots are written to and read from
GCS objects.
Change-Id: I985ccf301ada1bfde82e4e61e1ddf724a824fcb6
Reviewed-on: https://go-review.googlesource.com/c/website/+/373720
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
To allow for the use of TypeScript in go.dev pages
added a handler for TypeScript files served from
_content/ts. Files requested from this directory
are first transformed from TypeScript to JavaScript
using github.com/evanw/esbuild. JavaScript output is
written to a simple cache so subsequent requests skip
the tranformation step.
Change-Id: I0a161ce3dd20eaddddd5d369d359c65c90d9f607
Reviewed-on: https://go-review.googlesource.com/c/website/+/373718
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Screentest scripts are parsed as go templates. Passing
headers from the command line is replaced by the header
keyword in test scripts. Data can be interpolated into
headers using go template strings.
For example `header Authorization: Bearer {{.Token}}`
would become `header Authorization: Bearer abcdef` after
running `screentest -vars "Token:abcdef" testdata/file.txt`.
Change-Id: Ia27b9e12c68ca3bdbe609d3714d57d8867c2b351
Reviewed-on: https://go-review.googlesource.com/c/website/+/373715
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Added the eval keyword to allow for evaluating JS. Useful for
manipulating or hiding DOM elements prior to screenshot capture.
Change-Id: I508f3949c2eed7d55fc4e168781ab4c3e00edb5b
Reviewed-on: https://go-review.googlesource.com/c/website/+/373714
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
To speed up subsequent test runs or for use in CI testing
screenshots can be cached for an origin server by adding
the ::cache suffix to the URL.
For example, https://go.dev::cache.
Change-Id: I6ae6fd3f8f6f9fe884f74af6fb9ec7e6666e2f8b
Reviewed-on: https://go-review.googlesource.com/c/website/+/373477
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Updated the test reader to generate outfile paths
prior to test runs so that it is easier to read/write
to a cache of images in a future CL.
Change-Id: I3f27194c3fb7d215d5d258fe24da0b2b8ff53a5f
Reviewed-on: https://go-review.googlesource.com/c/website/+/373476
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
As we clean up page styles post golang.org and go.dev merge,
and begin to implement the dark theme, we can use screenshot
testing to check that code changes don't result in unintended
style or html content changes.
Change-Id: Ia65f98f133df0f4a9fa3f382fd30c2455d65d73d
Reviewed-on: https://go-review.googlesource.com/c/website/+/371435
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
This lets people choose between the release version of Go (play.golang.org)
and the dev branch version (gotipplay.golang.org).
After CL 365854 goes live, it will offer Go 1.17, Go 1.16, and Go dev branch.
Change-Id: I7480a0cb4f1b09636f5728c41af507aac5a72026
Reviewed-on: https://go-review.googlesource.com/c/website/+/366056
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>
go.dev uses /_/fmt, not /fmt.
Fix the JavaScript and then the standalone tour binary to both use /_/fmt too.
Fixesgolang/go#49746.
Change-Id: Ic59c6afb99748ed8c3e74c69c2d753671d92432b
Reviewed-on: https://go-review.googlesource.com/c/website/+/366977
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
There is something wrong with the tests, and we don't really need them.
This code was just copied from the main repo's internal/fmtsort in order
to support internal/backport/text/template. If the template tests are happy,
we are happy.
Fixesgolang/go#49732.
Change-Id: I109e13e4ec7c40ab06d84cba05fcdcdf8ba0c8d9
Reviewed-on: https://go-review.googlesource.com/c/website/+/366954
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The playground js was coming from
godoc instead of the updated copy in go.dev.
Change-Id: I26be8634b0e5d453b966be758f08c15b4bc7ca72
Reviewed-on: https://go-review.googlesource.com/c/website/+/366376
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
This is the last user-facing golang.org domain.
Now everything is on go.dev.
Change-Id: I8d9f4b7609a019f077848825cbd417d38058a5ac
Reviewed-on: https://go-review.googlesource.com/c/website/+/365494
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>
This is an almost unmodified copy of
golang.org/x/tools/cmd/present/dir.go
as of 43b469a (Nov 17 2021).
The only modification is adding a '//go:build ignore' line.
Checking this file in will let the next CL show the diffs
for adaptation to x/website.
Change-Id: I808886338df44878b728be096b91b6aa8179be56
Reviewed-on: https://go-review.googlesource.com/c/website/+/365134
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>
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>
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>
As described in https://go.dev/blog/tidy-web,
redirect golang.org to go.dev.
The golang.org home page is retired -
go.dev now has all the same info and links,
and it doesn't have ten-year-old videos of me.
All the other golang.org pages are now served
directly from go.dev, styled differently but with
the same content.
A followup CL will merge the _content directories.
Change-Id: Ib7f3d951842c021280981f9b926c4943f4d9cb52
Reviewed-on: https://go-review.googlesource.com/c/website/+/364859
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
This is a replacement for the UI of play.golang.org,
although it still uses play.golang.org as the backend
and probably always will, to keep the playground backend
deployment separate from the rest of the web site.
Change-Id: Ia39000e80368b98d9cc273d246f2c83670fbacc4
Reviewed-on: https://go-review.googlesource.com/c/website/+/364815
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>
This makes internal/short like most of the other registrations.
Preparation for the golang.org -> go.dev move.
Change-Id: I55039d6d668ac38ddb8e2412b7ab7ff44db8dd97
Reviewed-on: https://go-review.googlesource.com/c/website/+/362497
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Added a copy of the datastore content for use offline.
This lets us test download page rendering locally.
Preparation for the golang.org -> go.dev move.
Change-Id: Ic0c49a96329eed4310dd91e03c4ea832189ef65a
Reviewed-on: https://go-review.googlesource.com/c/website/+/362496
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Change-Id: Ice3c14820da241b24394bc38ab7b30fad4de656d
Reviewed-on: https://go-review.googlesource.com/c/website/+/361201
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
Change-Id: I555f2e1c396ceffc7819cf423226f556bb4af5f5
Reviewed-on: https://go-review.googlesource.com/c/website/+/354570
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
Website-Publish: DO NOT USE <dmitshur@google.com>
Change-Id: I64708dacaed4afc24332fb79a3ad3b4cf586514e
Reviewed-on: https://go-review.googlesource.com/c/website/+/348809
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
The windows/arm64 port is new to Go 1.17 and one of its key features.
Highlight the Windows ARM64 installer, just like the Windows AMD64
installer is highlighted. (Keep the zip archives and 386 installer
not highlighted.)
For golang/go#36439.
Change-Id: Ib57e80465d0ca090d165e14e3c4afdb2efca0c11
Reviewed-on: https://go-review.googlesource.com/c/website/+/344070
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
ARM64 makes for a better pretty string for the "arm64" architecture.
It's more clear that it's 64-bit, and it's closer to what we almost
always say.
Thanks to Cherry for making this suggestion.
For golang/go#38485.
For golang/go#36439.
Change-Id: I89c175ea2bafce6f191ae797ed982c73962ee5da
Reviewed-on: https://go-review.googlesource.com/c/website/+/344069
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Go 1.16 is available on App Engine now, so use it.
Also, Go 1.17 has been released, meaning
we don't need to keep Go 1.15 builders working.
Delete all the Go 1.16 backports except the template packages,
which contain modifications we need.
Change-Id: I4612441a1484ce9272a22268da73d67f7624309b
Reviewed-on: https://go-review.googlesource.com/c/website/+/343935
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Featured downloads on golang.org/dl use the latest Go release, which
is now Go 1.17. Per golang.org/doc/go1.17#darwin, Go 1.17 requires
macOS 10.13 High Sierra or later.
For golang/go#23011.
Fixesgolang/go#47867.
Change-Id: I868d118f073977c74429d70ae9ab7c526d098cf7
Reviewed-on: https://go-review.googlesource.com/c/website/+/344071
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
Also hard-code EnforceHosts behavior.
It was only optional to enable the old tip.golang.org server,
but that code is dead or at least no longer pointed to by DNS.
Hard-coding the EnforceHosts behavior makes for fewer
prod-only test failures.
Change-Id: Ib958b3f088c8175e67708efcd07426b9628b207b
Reviewed-on: https://go-review.googlesource.com/c/website/+/343311
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
This is the first of a sequence of consolidations of web sites into
the single site go.dev. An accompanying blog post (next CL) will
explain the change.
The blog/_content tree moves to go.dev/_content/blog.
The *.article files were converted to *.md files using rsc.io/tmp/blog2md.
The old dot directives are now template function invocations,
so that blog content files are now exactly the same format and
semantics as regular site content files.
All the old blog redirects are carried forward, of course.
Also add exhaustive test that every .md file renders correctly.
Also rename rawhtml to raw, because it gets used for raw Markdown too.
The raw Markdown issue is working around a bigger problem
(html/template is not really right for Markdown) that we will have
to solve at some point, but not in this CL.
Change-Id: Ifa9b3b8d656a72af30d0d4e57e4c7bc8dacbc386
Reviewed-on: https://go-review.googlesource.com/c/website/+/342091
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>
internal/web was the framework left serving golang.org.
go.dev/cmd/internal/site was the framework serving go.dev.
This CL merges the two into a coherent, simple site serving
framework that works for both sites, a step toward merging
the sites themselves.
The CL is difficult to break up, so it's a bit larger than would be ideal.
The best place to start is the doc comment in internal/web/site.go
and then the other changes in that directory.
The rest of the CL is just minor adjustments to the repo to match.
Change-Id: I927dea29396104a817bd81b6bf25fa43f996968f
Reviewed-on: https://go-review.googlesource.com/c/website/+/339403
Trust: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
There's no real need for these to be written in Go.
Change-Id: Ifb3ebc99a06bb9670a39238a1ddf370c2dcd6a22
Reviewed-on: https://go-review.googlesource.com/c/website/+/339402
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Make internal/tmplfunc available to the whole module,
as one more step toward merging internal/web and go.dev/cmd/internal/site.
Also bring in rsc.io/tmplfunc support for fs.FS.
Change-Id: I65486c32136ec500de172b8297d0605fef9d5c83
Reviewed-on: https://go-review.googlesource.com/c/website/+/339401
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Change-Id: Idbb89a88af787472e48bbc3f437462842156af3f
Reviewed-on: https://go-review.googlesource.com/c/website/+/342483
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Currently, tip.golang.org is deployed by a background loop
that fetches the latest Go and website repos every few minutes
and then does a deploy to a whole separate app.
Because this setup is different from the main app deploy,
it often gets broken by changes in the way the main app runs.
This CL removes the recurring source of breakage by making
the main app capable of serving tip.golang.org directly.
It does this by watching the main Go repo itself and downloading
a new copy of the file tree whenever there are changes.
The website repo is not watched: new changes to the website
repo already result in redeploys of the entire app when appropriate.
This CL does not actually enable the new tip.golang.org code.
A followup CL will do that, for easier rollback.
Change-Id: I015368c614579c90fa72a6699f6ab76202f87e7e
Reviewed-on: https://go-review.googlesource.com/c/website/+/328214
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 code is new and not anywhere else at the moment.
It is for a new implementation of tip.golang.org.
Change-Id: I176630816587387c08cdc53993889a5009612565
Reviewed-on: https://go-review.googlesource.com/c/website/+/328213
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>
Change-Id: I7650239269944f3f48876cb57174ed9ffc63c1d1
Reviewed-on: https://go-review.googlesource.com/c/website/+/340169
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Website-Publish: DO NOT USE <dmitshur@google.com>
Not all the package docs-specific parts of the server moved into
internal/pkgdoc before. Finish the job. Now the API for pkgdoc
is like the API for codewalk: just a NewServer that returns a handler.
Speaking of codewalk, unexport the Server type to match the
trimmed-down pkgdoc.
Change-Id: I19ba7351d55fb5d23d551a0296bb89d8abac6e9b
Reviewed-on: https://go-review.googlesource.com/c/website/+/328212
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>
CL 317655 introduced an issue causing non-playground code examples
to be double-escaped, causing HTML escape sequences and elements
to appear in the code, such as the examples in crypto/rsa,
as reported in golang/go#46839. This change treats the code as
template.HTML rather than string after running through (*Page).Node
(which formats the code as HTML) and doing some basic transformations,
preventing this double-escaping from occurring.
Fixesgolang/go#46839
Change-Id: Id226147eb51219bd5e2db61e959519258e39a298
GitHub-Last-Rev: 81f8dc5e87
GitHub-Pull-Request: golang/website#73
Reviewed-on: https://go-review.googlesource.com/c/website/+/332889
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@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>
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>
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>
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>
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>
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>
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>
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>
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>
- convert from text/template to html/template
- use proper template set
- always pass *godoc.Page to templates, with custom value in .Data
- move stateful site template functions to methods on *godoc.Page
- unexport Presentation.ServeFile: ServeHTTP is good enough
- reorder api.DB.Func args to match source order (pkg first)
- rename lib/godoc/godoc.html to lib/godoc/site.html
(lib/godoc itself must stay lib/godoc because of links to other content it holds).
Change-Id: I873f17db20107fdab11d276932e6d847a6081015
Reviewed-on: https://go-review.googlesource.com/c/website/+/317655
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Redirects can be handled by internal/redirect.
Raw-text serving is already handled in internal/godoc.
It can handle robots.txt and /doc/play/ too and avoid
exposing the underlying FileServer.
Change-Id: I11dda651128815b17cbd3a5db6572f21067529a7
Reviewed-on: https://go-review.googlesource.com/c/website/+/317653
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>
Second security+dot release, another custom summary.
Change-Id: Ic36179259896f06cdbe7958f8d45628dc41f2ac3
Reviewed-on: https://go-review.googlesource.com/c/website/+/324772
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
There's nothing left in Corpus but the file system and the API database.
Hoist them into Presentation and delete the Corpus itself.
Change-Id: I2cb61b77122b2f7216b0b2a96fd6b48e29eae189
Reviewed-on: https://go-review.googlesource.com/c/website/+/317651
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Back when the entire site had to live in $GOROOT/doc, we needed
some way to specify content that was served from URLs outside of golang.org/doc,
so we added the ability for a doc to declare its own URL (the Path metadata).
That meant the file system layout did not match the URL layout.
That meant the content for any particular URL could be anywhere in the file system.
That meant the entire file system had to be scanned to serve a URL.
That meant an index of the file system had to be built and updated.
Now that we have a file tree (_content) for the whole of golang.org,
we can move files to make the file system layout match the URL space.
Then each URL can be served by just reading the right file.
Then the index and its updater can be deleted.
And now if you want to edit /doc/gdb it's obvious which file to open.
Change-Id: I3357f275e61a31c8de3091af580cac80753e71a4
Reviewed-on: https://go-review.googlesource.com/c/website/+/296383
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
The special cases were simulating the normal template execution
and passing extra data (the release history).
We have a standard way to pass extra data (template functions),
so use one and delete the special case code.
Also change date format to standard yyyy-mm-dd.
The yyyy/mm/dd we have been using is kind of made up
and certainly unusual (see https://xkcd.com/1179/).
Change-Id: I59f4f67259381dd43cd53c0f6120f87d8f8c77d9
Reviewed-on: https://go-review.googlesource.com/c/website/+/296429
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>
1.16.4 and 1.15.12 are our first releases containing public security
fixes. As such, the existing template doesn't work well for them, so use
a CustomSummary.
Change-Id: Ib70990425b1a2963030b1034295a20b4c105c630
Reviewed-on: https://go-review.googlesource.com/c/website/+/317609
Trust: Heschi Kreinick <heschi@google.com>
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
The current macOS release filenames no longer include a "-osx10.8"
suffix, so the featured file regexp can made shorter and simpler.
Change-Id: Ia6a1b58e20909ba9485e02b51ee4b0297f6ff20e
Reviewed-on: https://go-review.googlesource.com/c/website/+/293589
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
file.Name.Name should match the directory name not the filename.
In CL 296378, newDirTree's name parameter was removed and synopsis
matched against the filename of the source code, e.g. "*.go".
Fixesgolang/go#45042Fixesgolang/go#45614
Change-Id: Ifa4c8a70429e277efb1f9f726de9249509cbcee0
Reviewed-on: https://go-review.googlesource.com/c/website/+/311089
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
This change removes adg, bradfitz, cbro, andybons and julieqiu from
the list of valid users. They are not expected to be releasing Go at
any point in the near future.
Change-Id: I38fd878f4c9487402ad61bab8b3d8c6437dd9763
Reviewed-on: https://go-review.googlesource.com/c/website/+/305689
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
For golang/go#45334.
For golang/go#45333.
Change-Id: I7928cf48bad658ca7dd391b84802e0c8bb788617
Reviewed-on: https://go-review.googlesource.com/c/website/+/306670
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Change-Id: I22025263b8d33e236671748fad9ef46ebc4441d1
Reviewed-on: https://go-review.googlesource.com/c/website/+/305531
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
The downloads page has a link pointing to a section about module proxy
servers in the cmd/go doc that was removed in CL 282615. Remove the
anchor.
Fixesgolang/go#44780
Change-Id: Ifb7f4f991b3314a3cda6d00d77925401a8830456
Reviewed-on: https://go-review.googlesource.com/c/website/+/299129
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This makes various other code movement a bit nicer.
Change-Id: I89c46dcbf3019eead4922f4db301bf0ea82b697e
Reviewed-on: https://go-review.googlesource.com/c/website/+/296379
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>
- IsGOROOT is always true (the only docs we serve)
- SummarizePackage is unused
- newDirectory is only called on the root with unlimited depth
- Name is redundant with Path
- Directory.Depth is unused
- only DirEntry is assigned to dirEntryOrFileInfo
- parallel walk is only needed for huge trees (GOROOT is not)
- separate entirely from Corpus
- pull new DocTree out of handlerServer
This will let us better separate the package doc tree from HTTP service
and from the general document server.
Change-Id: Iac667a0ff624306cdd535a33dd22dcb04062b46c
Reviewed-on: https://go-review.googlesource.com/c/website/+/296378
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>
There is lots of dead flexibility in this code.
Remove it, to make the control flow and data dependencies
easier to understand.
Change-Id: Ie9aa7bc96afc64d2a07677a73f8fb311808ef307
Reviewed-on: https://go-review.googlesource.com/c/website/+/296377
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>
Mainly just isolate it from Presentation, but give it a nice API too.
Change-Id: I9650bf650a15bfd814fe4da58de6fa133a858d90
Reviewed-on: https://go-review.googlesource.com/c/website/+/296374
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>
Now that all the references are internal
(the direct playground reference is gone),
we can use internal/env instead.
Change-Id: I10d323a5e08bee153bd921cffe79fb4eb9e8b29c
Reviewed-on: https://go-review.googlesource.com/c/website/+/293426
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>
Gerrit CL numbers now exceed 300k, so new CL numbers are landing on the
Gerrit/Rietveld disambiguation page.
Bump bigEnoughAssumeRietveld to 4M (approximately the max before we need
to handle subrepos) and update the table. Now we won't need to deal with
this again for quite a while.
Change-Id: I6ddd8cdd19012f0b58e39c2df76ff23f376c2f1b
Reviewed-on: https://go-review.googlesource.com/c/website/+/300089
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
The time stamps are unlikely to be useful or correct.
Today golang.org shows the release time for all files,
which has zero information content. Drop them.
Do not show size for directories - it's meaningless.
Show all directories before all files for easier navigation
and to keep package sources listed more compactly.
Change-Id: I06247988003e310aa19ecec7399b94f315e323bd
Reviewed-on: https://go-review.googlesource.com/c/website/+/293495
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Only used by godoc, so just move the utility code into the main package.
Down to a single directory.
Change-Id: I1bef28ce932372d748dd062eb6597d8979a26b08
Reviewed-on: https://go-review.googlesource.com/c/website/+/293491
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
We no longer use GOPATH at all, so all that matters is whether
the directory is GOROOT or not. We don't need the file system
to tell us - we can check whether a known file exists, like
src/math/abs.go.
Change-Id: I9d4efb9d0d3882a4875aa7176ce21ed24ede3f4d
Reviewed-on: https://go-review.googlesource.com/c/website/+/293428
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
We no longer serve search from the golang.org site.
Change-Id: I8b855cf664f175c0dc46a91e3017df1bebb28281
Reviewed-on: https://go-review.googlesource.com/c/website/+/293427
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
We have never run this code on golang.org.
Change-Id: Iba632f00ea055308c036f389e3af56ab11781832
Reviewed-on: https://go-review.googlesource.com/c/website/+/293423
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This is a straight copy of golang.org/x/tools/godoc@123adc86bc
(CL 291669) with internal import paths updated, gofmt run,
and go17_test.go folded into godoc_test.go (we are well past Go 1.7 now).
The next CL will change cmd/golangorg to use it, and then
we can start making adjustments to delete lots of unused code,
without worrying about affecting any external importers of
the original.
This CL brings in 16,290 lines of code, but less than 2,000
will actually remain once all the no-longer-needed code is
deleted in followup CLs.
Change-Id: I40ff57fe610b252df8bd6bb5de1114cdd7a750a2
Reviewed-on: https://go-review.googlesource.com/c/website/+/293420
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
The search feature is not used much and does not give terribly useful answers.
It accounts for under 2% of golang.org traffic and about one real query per minute.
Looking through a log of 1,592 search queries over a 28-hour period last week,
almost all of them would have found better answers using Google or pkg.go.dev.
Just a few examples of queries for which we had no good answers:
- 1.16
- 1.16beta
- GOPATH
- k8s.io/api/settings/v1alpha1
- language and capacity
- linux installation
- logical operators
- mocking struct
- naming convention
- remove element from slice
- sirupsen/logrus
- string template
- struct field tag
- tutorial
- update go
- using go modules
- visual studio code
Removing the search box on the main site will stop acting as though it gives
useful information for queries like these. Then hopefully people will find their
way to Google or pkg.go.dev instead.
Fixes#44357.
Change-Id: I400157e478a9faaf35c3fdb60380336ee0b135a3
Reviewed-on: https://go-review.googlesource.com/c/website/+/292590
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>
Change-Id: Ieb559df248ea4c7bdf23ef199e0520caf06a6de2
Reviewed-on: https://go-review.googlesource.com/c/website/+/292591
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>
Reviewed-by: Carlos Amedee <carlos@golang.org>
This lets us delete the generated static.go.
For golang/go#41102
Change-Id: Ie09f34a83f114592eec4ba2dd9263285169374ae
Reviewed-on: https://go-review.googlesource.com/c/website/+/291690
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>
Moves the HaTS trigger to the install doc pages so
that surveys will prompt while file downloads are
in progress.
Change-Id: I9437909c96907740fa21a0176d86b6adfe45d574
Reviewed-on: https://go-review.googlesource.com/c/website/+/286775
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
Adds a script to trigger HaTS on the download page in an
effort to track developer happiness with the core Go
distribution. Uses the same bucketing and rate limiting
logic as go.dev and pkg.go.dev.
Change-Id: I73cdb4577eaf71a77f09b94965e12871296a6699
Reviewed-on: https://go-review.googlesource.com/c/website/+/286293
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Change-Id: I1bbd0808fc43479a9fd84cc8e61dd8163aec96cf
Reviewed-on: https://go-review.googlesource.com/c/website/+/284872
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
We want the new darwin/arm64 installer and archive to be placed next
to the original darwin/amd64 files, not under "Other Ports". Also
highlight (make bold) the darwin/arm64 installer (but not archive).
The "pretty" version of the architecture will be displayed as "ARMv8",
and maybe should be made more macOS-specific in the future.
Updates golang/go#42756.
Change-Id: I5e95a3b93d30253d8fa291d153b3f96f49f9ab5d
Reviewed-on: https://go-review.googlesource.com/c/website/+/278787
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>