aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_content/doc/contribute.html6
-rw-r--r--cmd/golangorg/server.go1
-rw-r--r--cmd/golangorg/testdata/web.txt3
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