diff options
| author | Dmitri Shuralyov <dmitshur@golang.org> | 2021-08-27 18:06:53 -0500 |
|---|---|---|
| committer | Dmitri Shuralyov <dmitshur@google.com> | 2022-01-04 19:56:33 +0000 |
| commit | 2b23ec4809fbb9dabc982f7662a75ff4f14d8f8e (patch) | |
| tree | c3df9c38f23e1b67e24b260ee8e9d83239179353 | |
| parent | 995577f14f28bed40e5f61132f1b78adbdbbb3d9 (diff) | |
| download | go-x-website-2b23ec4809fbb9dabc982f7662a75ff4f14d8f8e.tar.xz | |
website: 2022 and onwards are the Years of the Gopher
The Go contribution guide was created in 2009 (commit 38a41eec67e5)
as part of the initial public release of Go.
It defined the standard copyright header for files in the Go tree.
Since files are copyrighted the year they are added,
having the current year in the header means it can be copied and
pasted into newly created files without further modification.
Given the year (2009 at the time) was written in a plain HTML file,
it needed to be updated every year to stay current.
Over the last 12 years, gophers assembled and performed this task:
• commit 38a41eec67e5 contribute.html (initial commit)
• go.dev/cl/184055 doc/contribute.html: change copyright year
• go.dev/cl/3907042 doc: contribution copyright year 2011
• go.dev/cl/5531048 doc: use 2012 for year in model standard copyright header
• go.dev/cl/7034044 doc: update standard copyright header
• go.dev/cl/46660043 2014: Year of the Gopher.
• go.dev/cl/2087 doc: 2015 will be the Year of the Gopher.
• go.dev/cl/18117 doc: 2016 is the Year of the Gopher.
• go.dev/cl/35240 doc: 2017 is the Year of the Gopher
• go.dev/cl/85775 doc: 2018 is the Year of the Gopher
• go.dev/cl/155928 doc: 2019 is the Year of the Gopher
• go.dev/cl/213017 doc: 2020 is the Year of the Gopher
• go.dev/cl/280163 doc: 2021 is the Year of the Gopher
In a way, this yearly tradition of updating HTML by hand was fun¹,
but we've now reached a convenient time to share the joy with our
friendly robot gophers.
Previously, the contribution guide lived in the main Go repository,
and a part of the website serving code was still in x/tools/godoc.
In 2021, Russ consolidated the remaining Go website content and code
all in x/website (for example, see CL 291693 and CL 293420). So now
everything we need is in one repo, making this trivial to automate,
and in doing so mark 2022 and beyond as the Years of the Gopher.
¹ See the commit messages and conversations in the linked CLs.
Change-Id: Ieab904b77d764c3e191f75923369ce461d7102c6
Reviewed-on: https://go-review.googlesource.com/c/website/+/375056
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>
| -rw-r--r-- | _content/doc/contribute.html | 6 | ||||
| -rw-r--r-- | cmd/golangorg/server.go | 1 | ||||
| -rw-r--r-- | cmd/golangorg/testdata/web.txt | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/_content/doc/contribute.html b/_content/doc/contribute.html index 070936e8..4b7af5f8 100644 --- a/_content/doc/contribute.html +++ b/_content/doc/contribute.html @@ -1,5 +1,6 @@ <!--{ - "Title": "Contribution Guide" + "Title": "Contribution Guide", + "Template": true }--> <p> @@ -1023,13 +1024,12 @@ New files that you contribute should use the standard copyright header: </p> <pre> -// Copyright 2021 The Go Authors. All rights reserved. +// Copyright {{now.UTC.Year}} The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. </pre> <p> -(Use the current year if you're reading this in 2022 or beyond.) Files in the repository are copyrighted the year they are added. Do not update the copyright year on files that you change. </p> diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go index 2b154b35..6e1b3718 100644 --- a/cmd/golangorg/server.go +++ b/cmd/golangorg/server.go @@ -255,6 +255,7 @@ func newSite(mux *http.ServeMux, host string, content, goroot fs.FS) (*web.Site, "releases": func() []*history.Major { return history.Majors }, "section": section, "version": func() string { return runtime.Version() }, + "now": func() time.Time { return time.Now() }, }) docs, err := pkgdoc.NewServer(fsys, site, googleCN) if err != nil { diff --git a/cmd/golangorg/testdata/web.txt b/cmd/golangorg/testdata/web.txt index ae1eb3f8..545bce24 100644 --- a/cmd/golangorg/testdata/web.txt +++ b/cmd/golangorg/testdata/web.txt @@ -390,6 +390,9 @@ GET https://go.dev/doc/codewalk/ body contains Codewalks body contains <td>How to Write a Codewalk</td> +GET https://go.dev/doc/contribute +body ~ ^// Copyright \d{4,} The Go Authors\. All rights reserved\.$ + GET https://golang.org/ref/mod redirect == https://go.dev/ref/mod |
