cmd/golangorg: remove special cases for /project/, /doc/devel/release
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>
diff --git a/_content/doc/contrib.html b/_content/doc/contrib.html
index d54d413..5d129df 100644
--- a/_content/doc/contrib.html
+++ b/_content/doc/contrib.html
@@ -35,22 +35,9 @@
<p>A <a href="/doc/devel/release.html">summary</a> of the changes between Go releases. Notes for the major releases:</p>
<ul>
- {{range .Major -}}
- <li><a href="/doc/go{{.V}}">Go {{.V}}</a> <small>({{.Date}})</small></li>
+ {{range releases -}}
+ <li><a href="/doc/go{{.Version}}">Go {{.Version}}</a> <small>({{.Date.Format "January 2006"}})</small></li>
{{end -}}
-
- {{- /* Entries for Go 1.9 and newer are generated using data in the internal/history package. */ -}}
- {{- /* Entries for Go 1.8 and older are hand-written as raw HTML below. */ -}}
-
- <li><a href="/doc/go1.8">Go 1.8</a> <small>(February 2017)</small></li>
- <li><a href="/doc/go1.7">Go 1.7</a> <small>(August 2016)</small></li>
- <li><a href="/doc/go1.6">Go 1.6</a> <small>(February 2016)</small></li>
- <li><a href="/doc/go1.5">Go 1.5</a> <small>(August 2015)</small></li>
- <li><a href="/doc/go1.4">Go 1.4</a> <small>(December 2014)</small></li>
- <li><a href="/doc/go1.3">Go 1.3</a> <small>(June 2014)</small></li>
- <li><a href="/doc/go1.2">Go 1.2</a> <small>(December 2013)</small></li>
- <li><a href="/doc/go1.1">Go 1.1</a> <small>(May 2013)</small></li>
- <li><a href="/doc/go1">Go 1</a> <small>(March 2012)</small></li>
</ul>
<h3 id="go1compat"><a href="/doc/go1compat">Go 1 and the Future of Go Programs</a></h3>
diff --git a/_content/doc/devel/release.html b/_content/doc/devel/release.html
index a67edab..3e887f6 100644
--- a/_content/doc/devel/release.html
+++ b/_content/doc/devel/release.html
@@ -24,29 +24,46 @@
(for example, Go 1.6.1, Go 1.6.2, and so on).
</p>
-{{range .Major}}
- <h2 id="go{{.V}}">go{{.V}} (released {{.Date}})</h2>
+{{range releases}}
+{{if ge .Version.Y 9}}
+ <h2 id="go{{.Version}}">go{{.Version}} (released {{.Date}})</h2>
<p>
- Go {{.V}} is a major release of Go.
- Read the <a href="/doc/go{{.V}}">Go {{.V}} Release Notes</a> for more information.
+ Go {{.Version}} is a major release of Go.
+ Read the <a href="/doc/go{{.Version}}">Go {{.Version}} Release Notes</a> for more information.
</p>
- {{if .Minor}}<h3 id="go{{.V}}.minor">Minor revisions</h3>{{end}}
+ {{if .Minor}}<h3 id="go{{.Version}}.minor">Minor revisions</h3>{{end}}
{{range .Minor}}
<p>
- go{{.V}}
- {{if .Released}}(released {{.Date}}){{else}}(planned for {{.Date}}){{end}}
- {{.Summary}}
+ go{{.Version}}
+ ({{if .Future}}planned for{{else}}released{{end}} {{.Date}})
+ {{with .CustomSummary}}
+ {{.}}
+ {{else}}
+ {{if .Future}}will include{{else}}includes{{end}}
+ {{.Quantifier}}
+ {{if .Security}}security{{end}}
+ {{if eq .Quantifier "a"}}fix{{else}}fixes{{end -}}
+ {{with .ComponentsAndPackages}} to {{.}}{{end}}.
+ {{.More}}
+
+ {{if not .Future}}
+ See the
+ <a href="https://github.com/golang/go/issues?q=milestone%3AGo{{.Version}}+label%3ACherryPickApproved">Go {{.Version}} milestone</a>
+ on our issue tracker for details.
+ {{end}}
+ {{end}}
</p>
{{end}}
{{end}}
+{{end}}
{{/* Entries for Go 1.9 and newer are generated using data in the internal/history package. */}}
{{/* Entries for Go 1.8.7 and older are hand-written as raw HTML below. */}}
-<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>
+<h2 id="go1.8">go1.8 (released 2017-02-16)</h2>
<p>
Go 1.8 is a major release of Go.
@@ -56,7 +73,7 @@
<h3 id="go1.8.minor">Minor revisions</h3>
<p>
-go1.8.1 (released 2017/04/07) includes fixes to the compiler, linker, runtime,
+go1.8.1 (released 2017-04-07) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command and the <code>crypto/tls</code>,
<code>encoding/xml</code>, <code>image/png</code>, <code>net</code>,
<code>net/http</code>, <code>reflect</code>, <code>text/template</code>,
@@ -66,28 +83,28 @@
</p>
<p>
-go1.8.2 (released 2017/05/23) includes a security fix to the
+go1.8.2 (released 2017-05-23) includes a security fix to the
<code>crypto/elliptic</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
1.8.2 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.3 (released 2017/05/24) includes fixes to the compiler, runtime,
+go1.8.3 (released 2017-05-24) includes fixes to the compiler, runtime,
documentation, and the <code>database/sql</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.3">Go
1.8.3 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.4 (released 2017/10/04) includes two security fixes.
+go1.8.4 (released 2017-10-04) includes two security fixes.
It contains the same fixes as Go 1.9.1 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.4">Go
1.8.4 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.5 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
+go1.8.5 (released 2017-10-25) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command,
and the <code>crypto/x509</code> and <code>net/smtp</code> packages.
It includes a fix to a bug introduced in Go 1.8.4 that broke <code>go</code> <code>get</code>
@@ -97,20 +114,20 @@
</p>
<p>
-go1.8.6 (released 2018/01/22) includes the same fix in <code>math/big</code>
+go1.8.6 (released 2018-01-22) includes the same fix in <code>math/big</code>
as Go 1.9.3 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.6">Go
1.8.6 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.7 (released 2018/02/07) includes a security fix to "go get".
+go1.8.7 (released 2018-02-07) includes a security fix to "go get".
It contains the same fix as Go 1.9.4 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.7">Go
1.8.7</a> milestone on our issue tracker for details.
</p>
-<h2 id="go1.7">go1.7 (released 2016/08/15)</h2>
+<h2 id="go1.7">go1.7 (released 2016-08-15)</h2>
<p>
Go 1.7 is a major release of Go.
@@ -120,7 +137,7 @@
<h3 id="go1.7.minor">Minor revisions</h3>
<p>
-go1.7.1 (released 2016/09/07) includes fixes to the compiler, runtime,
+go1.7.1 (released 2016-09-07) includes fixes to the compiler, runtime,
documentation, and the <code>compress/flate</code>, <code>hash/crc32</code>,
<code>io</code>, <code>net</code>, <code>net/http</code>,
<code>path/filepath</code>, <code>reflect</code>, and <code>syscall</code>
@@ -136,7 +153,7 @@
</p>
<p>
-go1.7.3 (released 2016/10/19) includes fixes to the compiler, runtime,
+go1.7.3 (released 2016-10-19) includes fixes to the compiler, runtime,
and the <code>crypto/cipher</code>, <code>crypto/tls</code>,
<code>net/http</code>, and <code>strings</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.3">Go
@@ -144,26 +161,26 @@
</p>
<p>
-go1.7.4 (released 2016/12/01) includes two security fixes.
+go1.7.4 (released 2016-12-01) includes two security fixes.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.4">Go
1.7.4 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.7.5 (released 2017/01/26) includes fixes to the compiler, runtime,
+go1.7.5 (released 2017-01-26) includes fixes to the compiler, runtime,
and the <code>crypto/x509</code> and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.5">Go
1.7.5 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.7.6 (released 2017/05/23) includes the same security fix as Go 1.8.2 and
+go1.7.6 (released 2017-05-23) includes the same security fix as Go 1.8.2 and
was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
1.8.2 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.6">go1.6 (released 2016/02/17)</h2>
+<h2 id="go1.6">go1.6 (released 2016-02-17)</h2>
<p>
Go 1.6 is a major release of Go.
@@ -173,13 +190,13 @@
<h3 id="go1.6.minor">Minor revisions</h3>
<p>
-go1.6.1 (released 2016/04/12) includes two security fixes.
+go1.6.1 (released 2016-04-12) includes two security fixes.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
1.6.1 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.6.2 (released 2016/04/20) includes fixes to the compiler, runtime, tools,
+go1.6.2 (released 2016-04-20) includes fixes to the compiler, runtime, tools,
documentation, and the <code>mime/multipart</code>, <code>net/http</code>, and
<code>sort</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.2">Go
@@ -187,7 +204,7 @@
</p>
<p>
-go1.6.3 (released 2016/07/17) includes security fixes to the
+go1.6.3 (released 2016-07-17) includes security fixes to the
<code>net/http/cgi</code> package and <code>net/http</code> package when used in
a CGI environment.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.3">Go
@@ -195,13 +212,13 @@
</p>
<p>
-go1.6.4 (released 2016/12/01) includes two security fixes.
+go1.6.4 (released 2016-12-01) includes two security fixes.
It contains the same fixes as Go 1.7.4 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.4">Go
1.7.4 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.5">go1.5 (released 2015/08/19)</h2>
+<h2 id="go1.5">go1.5 (released 2015-08-19)</h2>
<p>
Go 1.5 is a major release of Go.
@@ -211,7 +228,7 @@
<h3 id="go1.5.minor">Minor revisions</h3>
<p>
-go1.5.1 (released 2015/09/08) includes bug fixes to the compiler, assembler, and
+go1.5.1 (released 2015-09-08) includes bug fixes to the compiler, assembler, and
the <code>fmt</code>, <code>net/textproto</code>, <code>net/http</code>, and
<code>runtime</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.1">Go
@@ -219,7 +236,7 @@
</p>
<p>
-go1.5.2 (released 2015/12/02) includes bug fixes to the compiler, linker, and
+go1.5.2 (released 2015-12-02) includes bug fixes to the compiler, linker, and
the <code>mime/multipart</code>, <code>net</code>, and <code>runtime</code>
packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.2">Go
@@ -227,19 +244,19 @@
</p>
<p>
-go1.5.3 (released 2016/01/13) includes a security fix to the <code>math/big</code> package
+go1.5.3 (released 2016-01-13) includes a security fix to the <code>math/big</code> package
affecting the <code>crypto/tls</code> package.
See the <a href="https://golang.org/s/go153announce">release announcement</a> for details.
</p>
<p>
-go1.5.4 (released 2016/04/12) includes two security fixes.
+go1.5.4 (released 2016-04-12) includes two security fixes.
It contains the same fixes as Go 1.6.1 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
1.6.1 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.4">go1.4 (released 2014/12/10)</h2>
+<h2 id="go1.4">go1.4 (released 2014-12-10)</h2>
<p>
Go 1.4 is a major release of Go.
@@ -249,21 +266,21 @@
<h3 id="go1.4.minor">Minor revisions</h3>
<p>
-go1.4.1 (released 2015/01/15) includes bug fixes to the linker and the <code>log</code>, <code>syscall</code>, and <code>runtime</code> packages.
+go1.4.1 (released 2015-01-15) includes bug fixes to the linker and the <code>log</code>, <code>syscall</code>, and <code>runtime</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.1">Go 1.4.1 milestone on our issue tracker</a> for details.
</p>
<p>
-go1.4.2 (released 2015/02/17) includes bug fixes to the <code>go</code> command, the compiler and linker, and the <code>runtime</code>, <code>syscall</code>, <code>reflect</code>, and <code>math/big</code> packages.
+go1.4.2 (released 2015-02-17) includes bug fixes to the <code>go</code> command, the compiler and linker, and the <code>runtime</code>, <code>syscall</code>, <code>reflect</code>, and <code>math/big</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.2">Go 1.4.2 milestone on our issue tracker</a> for details.
</p>
<p>
-go1.4.3 (released 2015/09/22) includes security fixes to the <code>net/http</code> package and bug fixes to the <code>runtime</code> package.
+go1.4.3 (released 2015-09-22) includes security fixes to the <code>net/http</code> package and bug fixes to the <code>runtime</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.3">Go 1.4.3 milestone on our issue tracker</a> for details.
</p>
-<h2 id="go1.3">go1.3 (released 2014/06/18)</h2>
+<h2 id="go1.3">go1.3 (released 2014-06-18)</h2>
<p>
Go 1.3 is a major release of Go.
@@ -273,21 +290,21 @@
<h3 id="go1.3.minor">Minor revisions</h3>
<p>
-go1.3.1 (released 2014/08/13) includes bug fixes to the compiler and the <code>runtime</code>, <code>net</code>, and <code>crypto/rsa</code> packages.
+go1.3.1 (released 2014-08-13) includes bug fixes to the compiler and the <code>runtime</code>, <code>net</code>, and <code>crypto/rsa</code> packages.
See the <a href="https://github.com/golang/go/commits/go1.3.1">change history</a> for details.
</p>
<p>
-go1.3.2 (released 2014/09/25) includes bug fixes to cgo and the crypto/tls packages.
+go1.3.2 (released 2014-09-25) includes bug fixes to cgo and the crypto/tls packages.
See the <a href="https://github.com/golang/go/commits/go1.3.2">change history</a> for details.
</p>
<p>
-go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port.
+go1.3.3 (released 2014-09-30) includes further bug fixes to cgo, the runtime package, and the nacl port.
See the <a href="https://github.com/golang/go/commits/go1.3.3">change history</a> for details.
</p>
-<h2 id="go1.2">go1.2 (released 2013/12/01)</h2>
+<h2 id="go1.2">go1.2 (released 2013-12-01)</h2>
<p>
Go 1.2 is a major release of Go.
@@ -297,17 +314,17 @@
<h3 id="go1.2.minor">Minor revisions</h3>
<p>
-go1.2.1 (released 2014/03/02) includes bug fixes to the <code>runtime</code>, <code>net</code>, and <code>database/sql</code> packages.
+go1.2.1 (released 2014-03-02) includes bug fixes to the <code>runtime</code>, <code>net</code>, and <code>database/sql</code> packages.
See the <a href="https://github.com/golang/go/commits/go1.2.1">change history</a> for details.
</p>
<p>
-go1.2.2 (released 2014/05/05) includes a
+go1.2.2 (released 2014-05-05) includes a
<a href="https://github.com/golang/go/commits/go1.2.2">security fix</a>
that affects the tour binary included in the binary distributions (thanks to Guillaume T).
</p>
-<h2 id="go1.1">go1.1 (released 2013/05/13)</h2>
+<h2 id="go1.1">go1.1 (released 2013-05-13)</h2>
<p>
Go 1.1 is a major release of Go.
@@ -317,12 +334,12 @@
<h3 id="go1.1.minor">Minor revisions</h3>
<p>
-go1.1.1 (released 2013/06/13) includes several compiler and runtime bug fixes.
+go1.1.1 (released 2013-06-13) includes several compiler and runtime bug fixes.
See the <a href="https://github.com/golang/go/commits/go1.1.1">change history</a> for details.
</p>
<p>
-go1.1.2 (released 2013/08/13) includes fixes to the <code>gc</code> compiler
+go1.1.2 (released 2013-08-13) includes fixes to the <code>gc</code> compiler
and <code>cgo</code>, and the <code>bufio</code>, <code>runtime</code>,
<code>syscall</code>, and <code>time</code> packages.
See the <a href="https://github.com/golang/go/commits/go1.1.2">change history</a> for details.
@@ -332,7 +349,7 @@
that fixes <a href="//golang.org/issue/5949">issue 5949</a>.
</p>
-<h2 id="go1">go1 (released 2012/03/28)</h2>
+<h2 id="go1">go1 (released 2012-03-28)</h2>
<p>
Go 1 is a major release of Go that will be stable in the long term.
@@ -354,7 +371,7 @@
<h3 id="go1.minor">Minor revisions</h3>
<p>
-go1.0.1 (released 2012/04/25) was issued to
+go1.0.1 (released 2012-04-25) was issued to
<a href="//golang.org/cl/6061043">fix</a> an
<a href="//golang.org/issue/3545">escape analysis bug</a>
that can lead to memory corruption.
@@ -362,7 +379,7 @@
</p>
<p>
-go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation
+go1.0.2 (released 2012-06-13) was issued to fix two bugs in the implementation
of maps using struct or array keys:
<a href="//golang.org/issue/3695">issue 3695</a> and
<a href="//golang.org/issue/3573">issue 3573</a>.
@@ -370,7 +387,7 @@
</p>
<p>
-go1.0.3 (released 2012/09/21) includes minor code and documentation fixes.
+go1.0.3 (released 2012-09-21) includes minor code and documentation fixes.
</p>
<p>
@@ -383,4 +400,3 @@
See the <a href="pre_go1.html">Pre-Go 1 Release History</a> page for notes
on earlier releases.
</p>
-
diff --git a/cmd/golangorg/godoc.go b/cmd/golangorg/godoc.go
index 39049cf..2cd1b2a 100644
--- a/cmd/golangorg/godoc.go
+++ b/cmd/golangorg/godoc.go
@@ -8,42 +8,10 @@
package main
import (
- "bytes"
- "encoding/json"
"net/http"
"strings"
"golang.org/x/website/internal/env"
- "golang.org/x/website/internal/godoc"
-)
-
-// This file holds common code from the x/tools/godoc serving engine.
-// It's being used during the transition. See golang.org/issue/29206.
-
-// extractMetadata extracts the godoc.Metadata from a byte slice.
-// It returns the godoc.Metadata value and the remaining data.
-// If no metadata is present the original byte slice is returned.
-//
-func extractMetadata(b []byte) (meta godoc.Metadata, tail []byte, _ error) {
- tail = b
- if !bytes.HasPrefix(b, jsonStart) {
- return godoc.Metadata{}, tail, nil
- }
- end := bytes.Index(b, jsonEnd)
- if end < 0 {
- return godoc.Metadata{}, tail, nil
- }
- b = b[len(jsonStart)-1 : end+1] // drop leading <!-- and include trailing }
- if err := json.Unmarshal(b, &meta); err != nil {
- return godoc.Metadata{}, nil, err
- }
- tail = tail[end+len(jsonEnd):]
- return meta, tail, nil
-}
-
-var (
- jsonStart = []byte("<!--{")
- jsonEnd = []byte("}-->")
)
// googleCN reports whether request r is considered
diff --git a/cmd/golangorg/godoc_test.go b/cmd/golangorg/godoc_test.go
index 1e18436..4e4ce88 100644
--- a/cmd/golangorg/godoc_test.go
+++ b/cmd/golangorg/godoc_test.go
@@ -259,6 +259,13 @@
},
releaseTag: "go1.11",
},
+ {
+ path: "/project/",
+ contains: []string{
+ `<li><a href="/doc/go1.14">Go 1.14</a> <small>(February 2020)</small></li>`,
+ `<li><a href="/doc/go1.1">Go 1.1</a> <small>(May 2013)</small></li>`,
+ },
+ },
}
for _, test := range tests {
url := fmt.Sprintf("http://%s%s", addr, test.path)
diff --git a/cmd/golangorg/handlers.go b/cmd/golangorg/handlers.go
index c7125c0..c000a97 100644
--- a/cmd/golangorg/handlers.go
+++ b/cmd/golangorg/handlers.go
@@ -19,7 +19,6 @@
"golang.org/x/website/internal/env"
"golang.org/x/website/internal/godoc"
- "golang.org/x/website/internal/history"
"golang.org/x/website/internal/redirect"
)
@@ -87,11 +86,9 @@
mux.Handle("/", pres)
mux.Handle("/blog/", http.HandlerFunc(blogHandler))
mux.Handle("/doc/codewalk/", http.HandlerFunc(codewalk))
- mux.Handle("/doc/devel/release.html", releaseHandler{ReleaseHistory: sortReleases(history.Releases)})
mux.Handle("/doc/play/", pres.FileServer())
mux.Handle("/fmt", http.HandlerFunc(fmtHandler))
mux.Handle("/pkg/C/", redirect.Handler("/cmd/cgo/"))
- mux.Handle("/project/", projectHandler{ReleaseHistory: sortMajorReleases(history.Releases)})
mux.Handle("/robots.txt", pres.FileServer())
mux.Handle("/x/", http.HandlerFunc(xHandler))
redirect.Register(mux)
diff --git a/cmd/golangorg/project.go b/cmd/golangorg/project.go
deleted file mode 100644
index 3b6d121..0000000
--- a/cmd/golangorg/project.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2020 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.
-
-//go:build go1.16
-// +build go1.16
-
-package main
-
-import (
- "bytes"
- "fmt"
- "html/template"
- "io/fs"
- "log"
- "net/http"
- "sort"
-
- "golang.org/x/website/internal/godoc"
- "golang.org/x/website/internal/history"
-)
-
-// projectHandler serves The Go Project page on /project/.
-type projectHandler struct {
- ReleaseHistory []MajorRelease // Pre-computed release history to display.
-}
-
-func (h projectHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
- if req.URL.Path != "/project/" {
- pres.ServeHTTP(w, req) // 404
- return
- }
-
- const relPath = "doc/contrib.html"
-
- src, err := fs.ReadFile(fsys, toFS(relPath))
- if err != nil {
- log.Printf("reading template %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
-
- meta, src, err := extractMetadata(src)
- if err != nil {
- log.Printf("decoding metadata %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
- if !meta.Template {
- err := fmt.Errorf("got non-template, want template")
- log.Printf("unexpected metadata %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
-
- page := godoc.Page{
- Title: meta.Title,
- Subtitle: meta.Subtitle,
- GoogleCN: googleCN(req),
- }
- data := projectTemplateData{
- Major: h.ReleaseHistory,
- }
-
- // Evaluate as HTML template.
- tmpl, err := template.New("").Parse(string(src))
- if err != nil {
- log.Printf("parsing template %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
- var buf bytes.Buffer
- if err := tmpl.Execute(&buf, data); err != nil {
- log.Printf("executing template %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
- src = buf.Bytes()
-
- page.Body = src
- pres.ServePage(w, page)
-}
-
-// sortMajorReleases returns a sorted list of major Go releases,
-// suitable to be displayed on the Go project page.
-func sortMajorReleases(rs map[history.GoVer]history.Release) []MajorRelease {
- var major []MajorRelease
- for v, r := range rs {
- if !v.IsMajor() {
- continue
- }
- major = append(major, MajorRelease{ver: v, rel: r})
- }
- sort.Slice(major, func(i, j int) bool {
- if major[i].ver.X != major[j].ver.X {
- return major[i].ver.X > major[j].ver.X
- }
- return major[i].ver.Y > major[j].ver.Y
- })
- return major
-}
-
-type projectTemplateData struct {
- Major []MajorRelease
-}
-
-// MajorRelease represents a major Go release entry as displayed on the Go project page.
-type MajorRelease struct {
- ver history.GoVer
- rel history.Release
-}
-
-// V returns the Go release version string, like "1.14", "1.14.1", "1.14.2", etc.
-func (r MajorRelease) V() string {
- return r.ver.String()
-}
-
-// Date returns the date of the release, formatted for display on the Go project page.
-func (r MajorRelease) Date() string {
- d := r.rel.Date
- return fmt.Sprintf("%s %d", d.Month, d.Year)
-}
diff --git a/cmd/golangorg/release.go b/cmd/golangorg/release.go
deleted file mode 100644
index 2438178..0000000
--- a/cmd/golangorg/release.go
+++ /dev/null
@@ -1,267 +0,0 @@
-// Copyright 2020 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.
-
-//go:build go1.16
-// +build go1.16
-
-package main
-
-import (
- "bytes"
- "fmt"
- "html"
- "html/template"
- "io/fs"
- "log"
- "net/http"
- "sort"
- "strings"
-
- "golang.org/x/website/internal/godoc"
- "golang.org/x/website/internal/history"
-)
-
-// releaseHandler serves the Release History page.
-type releaseHandler struct {
- ReleaseHistory []Major // Pre-computed release history to display.
-}
-
-func (h releaseHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
- const relPath = "doc/devel/release.html"
-
- src, err := fs.ReadFile(fsys, toFS(relPath))
- if err != nil {
- log.Printf("reading template %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
-
- meta, src, err := extractMetadata(src)
- if err != nil {
- log.Printf("decoding metadata %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
- if !meta.Template {
- err := fmt.Errorf("got non-template, want template")
- log.Printf("unexpected metadata %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
-
- page := godoc.Page{
- Title: meta.Title,
- Subtitle: meta.Subtitle,
- GoogleCN: googleCN(req),
- }
- data := releaseTemplateData{
- Major: h.ReleaseHistory,
- }
-
- // Evaluate as HTML template.
- tmpl, err := template.New("").Parse(string(src))
- if err != nil {
- log.Printf("parsing template %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
- var buf bytes.Buffer
- if err := tmpl.Execute(&buf, data); err != nil {
- log.Printf("executing template %s: %v", relPath, err)
- pres.ServeError(w, req, relPath, err)
- return
- }
- src = buf.Bytes()
-
- page.Body = src
- pres.ServePage(w, page)
-}
-
-// sortReleases returns a sorted list of Go releases, suitable to be
-// displayed on the Release History page. Releases are arranged into
-// major releases, each with minor revisions.
-func sortReleases(rs map[history.GoVer]history.Release) []Major {
- var major []Major
- byMajorVersion := make(map[history.GoVer]Major)
- for v, r := range rs {
- switch {
- case v.IsMajor():
- m := byMajorVersion[v]
- m.Release = Release{ver: v, rel: r}
- byMajorVersion[v] = m
- case v.IsMinor():
- m := byMajorVersion[majorOf(v)]
- m.Minor = append(m.Minor, Release{ver: v, rel: r})
- byMajorVersion[majorOf(v)] = m
- }
- }
- for _, m := range byMajorVersion {
- sort.Slice(m.Minor, func(i, j int) bool { return m.Minor[i].ver.Z < m.Minor[j].ver.Z })
- major = append(major, m)
- }
- sort.Slice(major, func(i, j int) bool {
- if major[i].ver.X != major[j].ver.X {
- return major[i].ver.X > major[j].ver.X
- }
- return major[i].ver.Y > major[j].ver.Y
- })
- return major
-}
-
-// majorOf takes a Go version like 1.5, 1.5.1, 1.5.2, etc.,
-// and returns the corresponding major version like 1.5.
-func majorOf(v history.GoVer) history.GoVer {
- return history.GoVer{X: v.X, Y: v.Y, Z: 0}
-}
-
-type releaseTemplateData struct {
- Major []Major
-}
-
-// Major represents a major Go release and its minor revisions
-// as displayed on the release history page.
-type Major struct {
- Release
- Minor []Release
-}
-
-// Release represents a Go release entry as displayed on the release history page.
-type Release struct {
- ver history.GoVer
- rel history.Release
-}
-
-// V returns the Go release version string, like "1.14", "1.14.1", "1.14.2", etc.
-func (r Release) V() string {
- return r.ver.String()
-}
-
-// Date returns the date of the release, formatted for display on the release history page.
-func (r Release) Date() string {
- d := r.rel.Date
- return fmt.Sprintf("%04d/%02d/%02d", d.Year, d.Month, d.Day)
-}
-
-// Released reports whether release r has been released.
-func (r Release) Released() bool {
- return !r.rel.Future
-}
-
-func (r Release) Summary() (template.HTML, error) {
- var buf bytes.Buffer
- err := releaseSummaryHTML.Execute(&buf, releaseSummaryTemplateData{
- V: r.V(),
- Security: r.rel.Security,
- Released: r.Released(),
- Quantifier: r.rel.Quantifier,
- ComponentsAndPackages: joinComponentsAndPackages(r.rel),
- More: r.rel.More,
- CustomSummary: r.rel.CustomSummary,
- })
- return template.HTML(buf.String()), err
-}
-
-type releaseSummaryTemplateData struct {
- V string // Go release version string, like "1.14", "1.14.1", "1.14.2", etc.
- Security bool // Security release.
- Released bool // Whether release has been released.
- Quantifier string // Optional quantifier. Empty string for unspecified amount of fixes (typical), "a" for a single fix, "two", "three" for multiple fixes, etc.
- ComponentsAndPackages template.HTML // Components and packages involved.
- More template.HTML // Additional release content.
- CustomSummary template.HTML // CustomSummary, if non-empty, replaces the entire release content summary with custom HTML.
-}
-
-var releaseSummaryHTML = template.Must(template.New("").Parse(`
-{{if not .CustomSummary}}
- {{if .Released}}includes{{else}}will include{{end}}
- {{.Quantifier}}
- {{if .Security}}security{{end}}
- {{if eq .Quantifier "a"}}fix{{else}}fixes{{end -}}
- {{with .ComponentsAndPackages}} to {{.}}{{end}}.
- {{.More}}
-
- {{if .Released}}
- See the
- <a href="https://github.com/golang/go/issues?q=milestone%3AGo{{.V}}+label%3ACherryPickApproved">Go
- {{.V}} milestone</a> on our issue tracker for details.
- {{end}}
-{{else}}
- {{.CustomSummary}}
-{{end}}
-`))
-
-// joinComponentsAndPackages joins components and packages involved
-// in a Go release for the purposes of being displayed on the
-// release history page, keeping English grammar rules in mind.
-//
-// The different special cases are:
-//
-// c1
-// c1 and c2
-// c1, c2, and c3
-//
-// the p1 package
-// the p1 and p2 packages
-// the p1, p2, and p3 packages
-//
-// c1 and [1 package]
-// c1, and [2 or more packages]
-// c1, c2, and [1 or more packages]
-//
-func joinComponentsAndPackages(r history.Release) template.HTML {
- var buf strings.Builder
-
- // List components, if any.
- for i, comp := range r.Components {
- if len(r.Packages) == 0 {
- // No packages, so components are joined with more rules.
- switch {
- case i != 0 && len(r.Components) == 2:
- buf.WriteString(" and ")
- case i != 0 && len(r.Components) >= 3 && i != len(r.Components)-1:
- buf.WriteString(", ")
- case i != 0 && len(r.Components) >= 3 && i == len(r.Components)-1:
- buf.WriteString(", and ")
- }
- } else {
- // When there are packages, all components are comma-separated.
- if i != 0 {
- buf.WriteString(", ")
- }
- }
- buf.WriteString(string(comp))
- }
-
- // Join components and packages using a comma and/or "and" as needed.
- if len(r.Components) > 0 && len(r.Packages) > 0 {
- if len(r.Components)+len(r.Packages) >= 3 {
- buf.WriteString(",")
- }
- buf.WriteString(" and ")
- }
-
- // List packages, if any.
- if len(r.Packages) > 0 {
- buf.WriteString("the ")
- }
- for i, pkg := range r.Packages {
- switch {
- case i != 0 && len(r.Packages) == 2:
- buf.WriteString(" and ")
- case i != 0 && len(r.Packages) >= 3 && i != len(r.Packages)-1:
- buf.WriteString(", ")
- case i != 0 && len(r.Packages) >= 3 && i == len(r.Packages)-1:
- buf.WriteString(", and ")
- }
- buf.WriteString("<code>" + html.EscapeString(pkg) + "</code>")
- }
- switch {
- case len(r.Packages) == 1:
- buf.WriteString(" package")
- case len(r.Packages) >= 2:
- buf.WriteString(" packages")
- }
-
- return template.HTML(buf.String())
-}
diff --git a/cmd/golangorg/release_test.go b/cmd/golangorg/release_test.go
index 5b2270b..499eef4 100644
--- a/cmd/golangorg/release_test.go
+++ b/cmd/golangorg/release_test.go
@@ -43,6 +43,10 @@
}
if !strings.Contains(foldSpace(rr.Body.String()), foldSpace(wantGo114HTML)) {
t.Errorf("got body that doesn't contain expected Go 1.14 release history entries")
+ println("HAVE")
+ println(rr.Body.String())
+ println("WANT")
+ println(wantGo114HTML)
}
if !strings.Contains(foldSpace(rr.Body.String()), foldSpace(wantGo113HTML)) {
t.Errorf("got body that doesn't contain expected Go 1.13 release history entries")
@@ -61,7 +65,7 @@
}
const wantGo114HTML = `
-<h2 id="go1.14">go1.14 (released 2020/02/25)</h2>
+<h2 id="go1.14">go1.14 (released 2020-02-25)</h2>
<p>
Go 1.14 is a major release of Go.
@@ -71,13 +75,13 @@
<h3 id="go1.14.minor">Minor revisions</h3>
<p>
-go1.14.1 (released 2020/03/19) includes fixes to the go command, tools, and the runtime. See the
+go1.14.1 (released 2020-03-19) includes fixes to the go command, tools, and the runtime. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.14.1+label%3ACherryPickApproved">Go
1.14.1 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.14.2 (released 2020/04/08) includes fixes to cgo, the go command, the runtime,
+go1.14.2 (released 2020-04-08) includes fixes to cgo, the go command, the runtime,
and the <code>os/exec</code> and <code>testing</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.14.2+label%3ACherryPickApproved">Go
1.14.2 milestone</a> on our issue tracker for details.
@@ -85,7 +89,7 @@
`
const wantGo113HTML = `
-<h2 id="go1.13">go1.13 (released 2019/09/03)</h2>
+<h2 id="go1.13">go1.13 (released 2019-09-03)</h2>
<p>
Go 1.13 is a major release of Go.
@@ -95,21 +99,21 @@
<h3 id="go1.13.minor">Minor revisions</h3>
<p>
-go1.13.1 (released 2019/09/25) includes security fixes to the
+go1.13.1 (released 2019-09-25) includes security fixes to the
<code>net/http</code> and <code>net/textproto</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.1+label%3ACherryPickApproved">Go
1.13.1 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.13.2 (released 2019/10/17) includes security fixes to the
+go1.13.2 (released 2019-10-17) includes security fixes to the
compiler and the <code>crypto/dsa</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.2+label%3ACherryPickApproved">Go
1.13.2 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.13.3 (released 2019/10/17) includes fixes to the go command,
+go1.13.3 (released 2019-10-17) includes fixes to the go command,
the toolchain, the runtime, and the <code>syscall</code>, <code>net</code>,
<code>net/http</code>, and <code>crypto/ecdsa</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.3+label%3ACherryPickApproved">Go
@@ -117,7 +121,7 @@
</p>
<p>
-go1.13.4 (released 2019/10/31) includes fixes to the <code>net/http</code> and
+go1.13.4 (released 2019-10-31) includes fixes to the <code>net/http</code> and
<code>syscall</code> packages. It also fixes an issue on macOS 10.15 Catalina
where the non-notarized installer and binaries were being
<a href="https://golang.org/issue/34986">rejected by Gatekeeper</a>.
@@ -126,42 +130,42 @@
</p>
<p>
-go1.13.5 (released 2019/12/04) includes fixes to the go command, the runtime,
+go1.13.5 (released 2019-12-04) includes fixes to the go command, the runtime,
the linker, and the <code>net/http</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.5+label%3ACherryPickApproved">Go
1.13.5 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.13.6 (released 2020/01/09) includes fixes to the runtime and
+go1.13.6 (released 2020-01-09) includes fixes to the runtime and
the <code>net/http</code> package. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.6+label%3ACherryPickApproved">Go
1.13.6 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.13.7 (released 2020/01/28) includes two security fixes to
+go1.13.7 (released 2020-01-28) includes two security fixes to
the <code>crypto/x509</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.7+label%3ACherryPickApproved">Go
1.13.7 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.13.8 (released 2020/02/12) includes fixes to the runtime, and the
+go1.13.8 (released 2020-02-12) includes fixes to the runtime, and the
<code>crypto/x509</code> and <code>net/http</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.8+label%3ACherryPickApproved">Go
1.13.8 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.13.9 (released 2020/03/19) includes fixes to the go command, tools, the runtime, the
+go1.13.9 (released 2020-03-19) includes fixes to the go command, tools, the runtime, the
toolchain, and the <code>crypto/cypher</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.9+label%3ACherryPickApproved">Go
1.13.9 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.13.10 (released 2020/04/08) includes fixes to the go command, the runtime,
+go1.13.10 (released 2020-04-08) includes fixes to the go command, the runtime,
and the <code>os/exec</code> and <code>time</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.10+label%3ACherryPickApproved">Go
1.13.10 milestone</a> on our issue tracker for details.
@@ -169,7 +173,7 @@
`
const wantOldReleaseHTML = `
-<h2 id="go1.12">go1.12 (released 2019/02/25)</h2>
+<h2 id="go1.12">go1.12 (released 2019-02-25)</h2>
<p>
Go 1.12 is a major release of Go.
@@ -179,7 +183,7 @@
<h3 id="go1.12.minor">Minor revisions</h3>
<p>
-go1.12.1 (released 2019/03/14) includes fixes to cgo, the compiler, the go
+go1.12.1 (released 2019-03-14) includes fixes to cgo, the compiler, the go
command, and the <code>fmt</code>, <code>net/smtp</code>, <code>os</code>,
<code>path/filepath</code>, <code>sync</code>, and <code>text/template</code>
packages. See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.1+label%3ACherryPickApproved">Go
@@ -187,7 +191,7 @@
</p>
<p>
-go1.12.2 (released 2019/04/05) includes fixes to the compiler, the go
+go1.12.2 (released 2019-04-05) includes fixes to the compiler, the go
command, the runtime, and the <code>doc</code>, <code>net</code>,
<code>net/http/httputil</code>, and <code>os</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.2+label%3ACherryPickApproved">Go
@@ -195,13 +199,13 @@
</p>
<p>
-go1.12.3 (released 2019/04/08) was accidentally released without its
+go1.12.3 (released 2019-04-08) was accidentally released without its
intended fix. It is identical to go1.12.2, except for its version
number. The intended fix is in go1.12.4.
</p>
<p>
-go1.12.4 (released 2019/04/11) fixes an issue where using the prebuilt binary
+go1.12.4 (released 2019-04-11) fixes an issue where using the prebuilt binary
releases on older versions of GNU/Linux
<a href="https://golang.org/issues/31293">led to failures</a>
when linking programs that used cgo.
@@ -209,14 +213,14 @@
</p>
<p>
-go1.12.5 (released 2019/05/06) includes fixes to the compiler, the linker,
+go1.12.5 (released 2019-05-06) includes fixes to the compiler, the linker,
the go command, the runtime, and the <code>os</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.5+label%3ACherryPickApproved">Go
1.12.5 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.6 (released 2019/06/11) includes fixes to the compiler, the linker,
+go1.12.6 (released 2019-06-11) includes fixes to the compiler, the linker,
the go command, and the <code>crypto/x509</code>, <code>net/http</code>, and
<code>os</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.6+label%3ACherryPickApproved">Go
@@ -224,81 +228,81 @@
</p>
<p>
-go1.12.7 (released 2019/07/08) includes fixes to cgo, the compiler,
+go1.12.7 (released 2019-07-08) includes fixes to cgo, the compiler,
and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.7+label%3ACherryPickApproved">Go
1.12.7 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.8 (released 2019/08/13) includes security fixes to the
+go1.12.8 (released 2019-08-13) includes security fixes to the
<code>net/http</code> and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.8+label%3ACherryPickApproved">Go
1.12.8 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.9 (released 2019/08/15) includes fixes to the linker,
+go1.12.9 (released 2019-08-15) includes fixes to the linker,
and the <code>os</code> and <code>math/big</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.9+label%3ACherryPickApproved">Go
1.12.9 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.10 (released 2019/09/25) includes security fixes to the
+go1.12.10 (released 2019-09-25) includes security fixes to the
<code>net/http</code> and <code>net/textproto</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.10+label%3ACherryPickApproved">Go
1.12.10 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.11 (released 2019/10/17) includes security fixes to the
+go1.12.11 (released 2019-10-17) includes security fixes to the
<code>crypto/dsa</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.11+label%3ACherryPickApproved">Go
1.12.11 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.12 (released 2019/10/17) includes fixes to the go command,
+go1.12.12 (released 2019-10-17) includes fixes to the go command,
runtime, and the <code>syscall</code> and <code>net</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.12+label%3ACherryPickApproved">Go
1.12.12 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.13 (released 2019/10/31) fixes an issue on macOS 10.15 Catalina
+go1.12.13 (released 2019-10-31) fixes an issue on macOS 10.15 Catalina
where the non-notarized installer and binaries were being
<a href="https://golang.org/issue/34986">rejected by Gatekeeper</a>.
Only macOS users who hit this issue need to update.
</p>
<p>
-go1.12.14 (released 2019/12/04) includes a fix to the runtime. See
+go1.12.14 (released 2019-12-04) includes a fix to the runtime. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.14+label%3ACherryPickApproved">Go
1.12.14 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.15 (released 2020/01/09) includes fixes to the runtime and
+go1.12.15 (released 2020-01-09) includes fixes to the runtime and
the <code>net/http</code> package. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.15+label%3ACherryPickApproved">Go
1.12.15 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.16 (released 2020/01/28) includes two security fixes to
+go1.12.16 (released 2020-01-28) includes two security fixes to
the <code>crypto/x509</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.16+label%3ACherryPickApproved">Go
1.12.16 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.12.17 (released 2020/02/12) includes a fix to the runtime. See
+go1.12.17 (released 2020-02-12) includes a fix to the runtime. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.12.17+label%3ACherryPickApproved">Go
1.12.17 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.11">go1.11 (released 2018/08/24)</h2>
+<h2 id="go1.11">go1.11 (released 2018-08-24)</h2>
<p>
Go 1.11 is a major release of Go.
@@ -308,7 +312,7 @@
<h3 id="go1.11.minor">Minor revisions</h3>
<p>
-go1.11.1 (released 2018/10/01) includes fixes to the compiler, documentation, go
+go1.11.1 (released 2018-10-01) includes fixes to the compiler, documentation, go
command, runtime, and the <code>crypto/x509</code>, <code>encoding/json</code>,
<code>go/types</code>, <code>net</code>, <code>net/http</code>, and
<code>reflect</code> packages.
@@ -317,7 +321,7 @@
</p>
<p>
-go1.11.2 (released 2018/11/02) includes fixes to the compiler, linker,
+go1.11.2 (released 2018-11-02) includes fixes to the compiler, linker,
documentation, go command, and the <code>database/sql</code> and
<code>go/types</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.2+label%3ACherryPickApproved">Go
@@ -325,14 +329,14 @@
</p>
<p>
-go1.11.3 (released 2018/12/12) includes three security fixes to "go get" and
+go1.11.3 (released 2018-12-12) includes three security fixes to "go get" and
the <code>crypto/x509</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.3+label%3ACherryPickApproved">Go
1.11.3 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.11.4 (released 2018/12/14) includes fixes to cgo, the compiler, linker,
+go1.11.4 (released 2018-12-14) includes fixes to cgo, the compiler, linker,
runtime, documentation, go command, and the <code>net/http</code> and
<code>go/types</code> packages.
It includes a fix to a bug introduced in Go 1.11.3 that broke <code>go</code>
@@ -342,14 +346,14 @@
</p>
<p>
-go1.11.5 (released 2019/01/23) includes a security fix to the
+go1.11.5 (released 2019-01-23) includes a security fix to the
<code>crypto/elliptic</code> package. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.5+label%3ACherryPickApproved">Go
1.11.5 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.11.6 (released 2019/03/14) includes fixes to cgo, the compiler, linker,
+go1.11.6 (released 2019-03-14) includes fixes to cgo, the compiler, linker,
runtime, go command, and the <code>crypto/x509</code>, <code>encoding/json</code>,
<code>net</code>, and <code>net/url</code> packages. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.6+label%3ACherryPickApproved">Go
@@ -357,20 +361,20 @@
</p>
<p>
-go1.11.7 (released 2019/04/05) includes fixes to the runtime and the
+go1.11.7 (released 2019-04-05) includes fixes to the runtime and the
<code>net</code> package. See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.7+label%3ACherryPickApproved">Go
1.11.7 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.11.8 (released 2019/04/08) was accidentally released without its
+go1.11.8 (released 2019-04-08) was accidentally released without its
intended fix. It is identical to go1.11.7, except for its version
number. The intended fix is in go1.11.9.
</p>
<p>
-go1.11.9 (released 2019/04/11) fixes an issue where using the prebuilt binary
+go1.11.9 (released 2019-04-11) fixes an issue where using the prebuilt binary
releases on older versions of GNU/Linux
<a href="https://golang.org/issues/31293">led to failures</a>
when linking programs that used cgo.
@@ -378,31 +382,31 @@
</p>
<p>
-go1.11.10 (released 2019/05/06) includes fixes to the runtime and the linker.
+go1.11.10 (released 2019-05-06) includes fixes to the runtime and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.10+label%3ACherryPickApproved">Go
1.11.10 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.11.11 (released 2019/06/11) includes a fix to the <code>crypto/x509</code> package.
+go1.11.11 (released 2019-06-11) includes a fix to the <code>crypto/x509</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.11+label%3ACherryPickApproved">Go
1.11.11 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.11.12 (released 2019/07/08) includes fixes to the compiler and the linker.
+go1.11.12 (released 2019-07-08) includes fixes to the compiler and the linker.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.12+label%3ACherryPickApproved">Go
1.11.12 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.11.13 (released 2019/08/13) includes security fixes to the
+go1.11.13 (released 2019-08-13) includes security fixes to the
<code>net/http</code> and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.13+label%3ACherryPickApproved">Go
1.11.13 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.10">go1.10 (released 2018/02/16)</h2>
+<h2 id="go1.10">go1.10 (released 2018-02-16)</h2>
<p>
Go 1.10 is a major release of Go.
@@ -412,7 +416,7 @@
<h3 id="go1.10.minor">Minor revisions</h3>
<p>
-go1.10.1 (released 2018/03/28) includes fixes to the compiler, runtime, and the
+go1.10.1 (released 2018-03-28) includes fixes to the compiler, runtime, and the
<code>archive/zip</code>, <code>crypto/tls</code>, <code>crypto/x509</code>,
<code>encoding/json</code>, <code>net</code>, <code>net/http</code>, and
<code>net/http/pprof</code> packages.
@@ -421,14 +425,14 @@
</p>
<p>
-go1.10.2 (released 2018/05/01) includes fixes to the compiler, linker, and go
+go1.10.2 (released 2018-05-01) includes fixes to the compiler, linker, and go
command.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.2+label%3ACherryPickApproved">Go
1.10.2 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.10.3 (released 2018/06/05) includes fixes to the go command, and the
+go1.10.3 (released 2018-06-05) includes fixes to the go command, and the
<code>crypto/tls</code>, <code>crypto/x509</code>, and <code>strings</code> packages.
In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.
@@ -437,7 +441,7 @@
</p>
<p>
-go1.10.4 (released 2018/08/24) includes fixes to the go command, linker, and the
+go1.10.4 (released 2018-08-24) includes fixes to the go command, linker, and the
<code>net/http</code>, <code>mime/multipart</code>, <code>ld/macho</code>,
<code>bytes</code>, and <code>strings</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.4+label%3ACherryPickApproved">Go
@@ -445,14 +449,14 @@
</p>
<p>
-go1.10.5 (released 2018/11/02) includes fixes to the go command, linker, runtime,
+go1.10.5 (released 2018-11-02) includes fixes to the go command, linker, runtime,
and the <code>database/sql</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.5+label%3ACherryPickApproved">Go
1.10.5 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.10.6 (released 2018/12/12) includes three security fixes to "go get" and
+go1.10.6 (released 2018-12-12) includes three security fixes to "go get" and
the <code>crypto/x509</code> package.
It contains the same fixes as Go 1.11.3 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.6+label%3ACherryPickApproved">Go
@@ -460,7 +464,7 @@
</p>
<p>
-go1.10.7 (released 2018/12/14) includes a fix to a bug introduced in Go 1.10.6
+go1.10.7 (released 2018-12-14) includes a fix to a bug introduced in Go 1.10.6
that broke <code>go</code> <code>get</code> for import path patterns containing
"<code>...</code>".
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.7+label%3ACherryPickApproved">
@@ -468,13 +472,13 @@
</p>
<p>
-go1.10.8 (released 2019/01/23) includes a security fix to the
+go1.10.8 (released 2019-01-23) includes a security fix to the
<code>crypto/elliptic</code> package. See
the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.8+label%3ACherryPickApproved">Go
1.10.8 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.9">go1.9 (released 2017/08/24)</h2>
+<h2 id="go1.9">go1.9 (released 2017-08-24)</h2>
<p>
Go 1.9 is a major release of Go.
@@ -484,13 +488,13 @@
<h3 id="go1.9.minor">Minor revisions</h3>
<p>
-go1.9.1 (released 2017/10/04) includes two security fixes.
+go1.9.1 (released 2017-10-04) includes two security fixes.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.1+label%3ACherryPickApproved">Go
1.9.1 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.9.2 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
+go1.9.2 (released 2017-10-25) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command,
and the <code>crypto/x509</code>, <code>database/sql</code>, <code>log</code>,
and <code>net/smtp</code> packages.
@@ -501,7 +505,7 @@
</p>
<p>
-go1.9.3 (released 2018/01/22) includes fixes to the compiler, runtime,
+go1.9.3 (released 2018-01-22) includes fixes to the compiler, runtime,
and the <code>database/sql</code>, <code>math/big</code>, <code>net/http</code>,
and <code>net/url</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.3+label%3ACherryPickApproved">Go
@@ -509,26 +513,26 @@
</p>
<p>
-go1.9.4 (released 2018/02/07) includes a security fix to "go get".
+go1.9.4 (released 2018-02-07) includes a security fix to "go get".
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.4+label%3ACherryPickApproved">Go
1.9.4 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.9.5 (released 2018/03/28) includes fixes to the compiler, go command, and the
+go1.9.5 (released 2018-03-28) includes fixes to the compiler, go command, and the
<code>net/http/pprof</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.5+label%3ACherryPickApproved">Go
1.9.5 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.9.6 (released 2018/05/01) includes fixes to the compiler and go command.
+go1.9.6 (released 2018-05-01) includes fixes to the compiler and go command.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.6+label%3ACherryPickApproved">Go
1.9.6 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.9.7 (released 2018/06/05) includes fixes to the go command, and the
+go1.9.7 (released 2018-06-05) includes fixes to the go command, and the
<code>crypto/x509</code> and <code>strings</code> packages.
In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.
@@ -536,7 +540,7 @@
1.9.7 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.8">go1.8 (released 2017/02/16)</h2>
+<h2 id="go1.8">go1.8 (released 2017-02-16)</h2>
<p>
Go 1.8 is a major release of Go.
@@ -546,7 +550,7 @@
<h3 id="go1.8.minor">Minor revisions</h3>
<p>
-go1.8.1 (released 2017/04/07) includes fixes to the compiler, linker, runtime,
+go1.8.1 (released 2017-04-07) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command and the <code>crypto/tls</code>,
<code>encoding/xml</code>, <code>image/png</code>, <code>net</code>,
<code>net/http</code>, <code>reflect</code>, <code>text/template</code>,
@@ -556,28 +560,28 @@
</p>
<p>
-go1.8.2 (released 2017/05/23) includes a security fix to the
+go1.8.2 (released 2017-05-23) includes a security fix to the
<code>crypto/elliptic</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
1.8.2 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.3 (released 2017/05/24) includes fixes to the compiler, runtime,
+go1.8.3 (released 2017-05-24) includes fixes to the compiler, runtime,
documentation, and the <code>database/sql</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.3">Go
1.8.3 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.4 (released 2017/10/04) includes two security fixes.
+go1.8.4 (released 2017-10-04) includes two security fixes.
It contains the same fixes as Go 1.9.1 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.4">Go
1.8.4 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.5 (released 2017/10/25) includes fixes to the compiler, linker, runtime,
+go1.8.5 (released 2017-10-25) includes fixes to the compiler, linker, runtime,
documentation, <code>go</code> command,
and the <code>crypto/x509</code> and <code>net/smtp</code> packages.
It includes a fix to a bug introduced in Go 1.8.4 that broke <code>go</code> <code>get</code>
@@ -587,20 +591,20 @@
</p>
<p>
-go1.8.6 (released 2018/01/22) includes the same fix in <code>math/big</code>
+go1.8.6 (released 2018-01-22) includes the same fix in <code>math/big</code>
as Go 1.9.3 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.6">Go
1.8.6 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.8.7 (released 2018/02/07) includes a security fix to "go get".
+go1.8.7 (released 2018-02-07) includes a security fix to "go get".
It contains the same fix as Go 1.9.4 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.7">Go
1.8.7</a> milestone on our issue tracker for details.
</p>
-<h2 id="go1.7">go1.7 (released 2016/08/15)</h2>
+<h2 id="go1.7">go1.7 (released 2016-08-15)</h2>
<p>
Go 1.7 is a major release of Go.
@@ -610,7 +614,7 @@
<h3 id="go1.7.minor">Minor revisions</h3>
<p>
-go1.7.1 (released 2016/09/07) includes fixes to the compiler, runtime,
+go1.7.1 (released 2016-09-07) includes fixes to the compiler, runtime,
documentation, and the <code>compress/flate</code>, <code>hash/crc32</code>,
<code>io</code>, <code>net</code>, <code>net/http</code>,
<code>path/filepath</code>, <code>reflect</code>, and <code>syscall</code>
@@ -626,7 +630,7 @@
</p>
<p>
-go1.7.3 (released 2016/10/19) includes fixes to the compiler, runtime,
+go1.7.3 (released 2016-10-19) includes fixes to the compiler, runtime,
and the <code>crypto/cipher</code>, <code>crypto/tls</code>,
<code>net/http</code>, and <code>strings</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.3">Go
@@ -634,26 +638,26 @@
</p>
<p>
-go1.7.4 (released 2016/12/01) includes two security fixes.
+go1.7.4 (released 2016-12-01) includes two security fixes.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.4">Go
1.7.4 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.7.5 (released 2017/01/26) includes fixes to the compiler, runtime,
+go1.7.5 (released 2017-01-26) includes fixes to the compiler, runtime,
and the <code>crypto/x509</code> and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.5">Go
1.7.5 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.7.6 (released 2017/05/23) includes the same security fix as Go 1.8.2 and
+go1.7.6 (released 2017-05-23) includes the same security fix as Go 1.8.2 and
was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.2">Go
1.8.2 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.6">go1.6 (released 2016/02/17)</h2>
+<h2 id="go1.6">go1.6 (released 2016-02-17)</h2>
<p>
Go 1.6 is a major release of Go.
@@ -663,13 +667,13 @@
<h3 id="go1.6.minor">Minor revisions</h3>
<p>
-go1.6.1 (released 2016/04/12) includes two security fixes.
+go1.6.1 (released 2016-04-12) includes two security fixes.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
1.6.1 milestone</a> on our issue tracker for details.
</p>
<p>
-go1.6.2 (released 2016/04/20) includes fixes to the compiler, runtime, tools,
+go1.6.2 (released 2016-04-20) includes fixes to the compiler, runtime, tools,
documentation, and the <code>mime/multipart</code>, <code>net/http</code>, and
<code>sort</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.2">Go
@@ -677,7 +681,7 @@
</p>
<p>
-go1.6.3 (released 2016/07/17) includes security fixes to the
+go1.6.3 (released 2016-07-17) includes security fixes to the
<code>net/http/cgi</code> package and <code>net/http</code> package when used in
a CGI environment.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.3">Go
@@ -685,13 +689,13 @@
</p>
<p>
-go1.6.4 (released 2016/12/01) includes two security fixes.
+go1.6.4 (released 2016-12-01) includes two security fixes.
It contains the same fixes as Go 1.7.4 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.4">Go
1.7.4 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.5">go1.5 (released 2015/08/19)</h2>
+<h2 id="go1.5">go1.5 (released 2015-08-19)</h2>
<p>
Go 1.5 is a major release of Go.
@@ -701,7 +705,7 @@
<h3 id="go1.5.minor">Minor revisions</h3>
<p>
-go1.5.1 (released 2015/09/08) includes bug fixes to the compiler, assembler, and
+go1.5.1 (released 2015-09-08) includes bug fixes to the compiler, assembler, and
the <code>fmt</code>, <code>net/textproto</code>, <code>net/http</code>, and
<code>runtime</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.1">Go
@@ -709,7 +713,7 @@
</p>
<p>
-go1.5.2 (released 2015/12/02) includes bug fixes to the compiler, linker, and
+go1.5.2 (released 2015-12-02) includes bug fixes to the compiler, linker, and
the <code>mime/multipart</code>, <code>net</code>, and <code>runtime</code>
packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.5.2">Go
@@ -717,19 +721,19 @@
</p>
<p>
-go1.5.3 (released 2016/01/13) includes a security fix to the <code>math/big</code> package
+go1.5.3 (released 2016-01-13) includes a security fix to the <code>math/big</code> package
affecting the <code>crypto/tls</code> package.
See the <a href="https://golang.org/s/go153announce">release announcement</a> for details.
</p>
<p>
-go1.5.4 (released 2016/04/12) includes two security fixes.
+go1.5.4 (released 2016-04-12) includes two security fixes.
It contains the same fixes as Go 1.6.1 and was released at the same time.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.6.1">Go
1.6.1 milestone</a> on our issue tracker for details.
</p>
-<h2 id="go1.4">go1.4 (released 2014/12/10)</h2>
+<h2 id="go1.4">go1.4 (released 2014-12-10)</h2>
<p>
Go 1.4 is a major release of Go.
@@ -739,21 +743,21 @@
<h3 id="go1.4.minor">Minor revisions</h3>
<p>
-go1.4.1 (released 2015/01/15) includes bug fixes to the linker and the <code>log</code>, <code>syscall</code>, and <code>runtime</code> packages.
+go1.4.1 (released 2015-01-15) includes bug fixes to the linker and the <code>log</code>, <code>syscall</code>, and <code>runtime</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.1">Go 1.4.1 milestone on our issue tracker</a> for details.
</p>
<p>
-go1.4.2 (released 2015/02/17) includes bug fixes to the <code>go</code> command, the compiler and linker, and the <code>runtime</code>, <code>syscall</code>, <code>reflect</code>, and <code>math/big</code> packages.
+go1.4.2 (released 2015-02-17) includes bug fixes to the <code>go</code> command, the compiler and linker, and the <code>runtime</code>, <code>syscall</code>, <code>reflect</code>, and <code>math/big</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.2">Go 1.4.2 milestone on our issue tracker</a> for details.
</p>
<p>
-go1.4.3 (released 2015/09/22) includes security fixes to the <code>net/http</code> package and bug fixes to the <code>runtime</code> package.
+go1.4.3 (released 2015-09-22) includes security fixes to the <code>net/http</code> package and bug fixes to the <code>runtime</code> package.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.3">Go 1.4.3 milestone on our issue tracker</a> for details.
</p>
-<h2 id="go1.3">go1.3 (released 2014/06/18)</h2>
+<h2 id="go1.3">go1.3 (released 2014-06-18)</h2>
<p>
Go 1.3 is a major release of Go.
@@ -763,21 +767,21 @@
<h3 id="go1.3.minor">Minor revisions</h3>
<p>
-go1.3.1 (released 2014/08/13) includes bug fixes to the compiler and the <code>runtime</code>, <code>net</code>, and <code>crypto/rsa</code> packages.
+go1.3.1 (released 2014-08-13) includes bug fixes to the compiler and the <code>runtime</code>, <code>net</code>, and <code>crypto/rsa</code> packages.
See the <a href="https://github.com/golang/go/commits/go1.3.1">change history</a> for details.
</p>
<p>
-go1.3.2 (released 2014/09/25) includes bug fixes to cgo and the crypto/tls packages.
+go1.3.2 (released 2014-09-25) includes bug fixes to cgo and the crypto/tls packages.
See the <a href="https://github.com/golang/go/commits/go1.3.2">change history</a> for details.
</p>
<p>
-go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port.
+go1.3.3 (released 2014-09-30) includes further bug fixes to cgo, the runtime package, and the nacl port.
See the <a href="https://github.com/golang/go/commits/go1.3.3">change history</a> for details.
</p>
-<h2 id="go1.2">go1.2 (released 2013/12/01)</h2>
+<h2 id="go1.2">go1.2 (released 2013-12-01)</h2>
<p>
Go 1.2 is a major release of Go.
@@ -787,17 +791,17 @@
<h3 id="go1.2.minor">Minor revisions</h3>
<p>
-go1.2.1 (released 2014/03/02) includes bug fixes to the <code>runtime</code>, <code>net</code>, and <code>database/sql</code> packages.
+go1.2.1 (released 2014-03-02) includes bug fixes to the <code>runtime</code>, <code>net</code>, and <code>database/sql</code> packages.
See the <a href="https://github.com/golang/go/commits/go1.2.1">change history</a> for details.
</p>
<p>
-go1.2.2 (released 2014/05/05) includes a
+go1.2.2 (released 2014-05-05) includes a
<a href="https://github.com/golang/go/commits/go1.2.2">security fix</a>
that affects the tour binary included in the binary distributions (thanks to Guillaume T).
</p>
-<h2 id="go1.1">go1.1 (released 2013/05/13)</h2>
+<h2 id="go1.1">go1.1 (released 2013-05-13)</h2>
<p>
Go 1.1 is a major release of Go.
@@ -807,12 +811,12 @@
<h3 id="go1.1.minor">Minor revisions</h3>
<p>
-go1.1.1 (released 2013/06/13) includes several compiler and runtime bug fixes.
+go1.1.1 (released 2013-06-13) includes several compiler and runtime bug fixes.
See the <a href="https://github.com/golang/go/commits/go1.1.1">change history</a> for details.
</p>
<p>
-go1.1.2 (released 2013/08/13) includes fixes to the <code>gc</code> compiler
+go1.1.2 (released 2013-08-13) includes fixes to the <code>gc</code> compiler
and <code>cgo</code>, and the <code>bufio</code>, <code>runtime</code>,
<code>syscall</code>, and <code>time</code> packages.
See the <a href="https://github.com/golang/go/commits/go1.1.2">change history</a> for details.
@@ -822,7 +826,7 @@
that fixes <a href="//golang.org/issue/5949">issue 5949</a>.
</p>
-<h2 id="go1">go1 (released 2012/03/28)</h2>
+<h2 id="go1">go1 (released 2012-03-28)</h2>
<p>
Go 1 is a major release of Go that will be stable in the long term.
@@ -844,7 +848,7 @@
<h3 id="go1.minor">Minor revisions</h3>
<p>
-go1.0.1 (released 2012/04/25) was issued to
+go1.0.1 (released 2012-04-25) was issued to
<a href="//golang.org/cl/6061043">fix</a> an
<a href="//golang.org/issue/3545">escape analysis bug</a>
that can lead to memory corruption.
@@ -852,7 +856,7 @@
</p>
<p>
-go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation
+go1.0.2 (released 2012-06-13) was issued to fix two bugs in the implementation
of maps using struct or array keys:
<a href="//golang.org/issue/3695">issue 3695</a> and
<a href="//golang.org/issue/3573">issue 3573</a>.
@@ -860,7 +864,7 @@
</p>
<p>
-go1.0.3 (released 2012/09/21) includes minor code and documentation fixes.
+go1.0.3 (released 2012-09-21) includes minor code and documentation fixes.
</p>
<p>
diff --git a/internal/godoc/godoc.go b/internal/godoc/godoc.go
index 3747b03..5b8ca55 100644
--- a/internal/godoc/godoc.go
+++ b/internal/godoc/godoc.go
@@ -18,6 +18,7 @@
"strings"
"text/template"
+ "golang.org/x/website/internal/history"
"golang.org/x/website/internal/pkgdoc"
)
@@ -41,7 +42,8 @@
panic("nil Presentation.Corpus")
}
p.templateFuncs = template.FuncMap{
- "code": p.code,
+ "code": p.code,
+ "releases": func() []*history.Major { return history.Majors },
}
p.funcMap = template.FuncMap{
// various helpers
diff --git a/internal/history/history.go b/internal/history/history.go
new file mode 100644
index 0000000..327b214
--- /dev/null
+++ b/internal/history/history.go
@@ -0,0 +1,210 @@
+// Copyright 2020 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.
+
+// Package history holds the Go project release history.
+package history
+
+import (
+ "fmt"
+ "html"
+ "html/template"
+ "sort"
+ "strings"
+ "time"
+)
+
+// A Release describes a single Go release.
+type Release struct {
+ Version Version
+ Date Date
+ Security bool // whether this is a security release
+ Future bool // if true, the release hasn't happened yet
+
+ // Release content summary.
+ Quantifier string // Optional quantifier. Empty string for unspecified amount of fixes (typical), "a" for a single fix, "two", "three" for multiple fixes, etc.
+ Components []template.HTML // Components involved. For example, "cgo", "the <code>go</code> command", "the runtime", etc.
+ Packages []string // Packages involved. For example, "net/http", "crypto/x509", etc.
+ More template.HTML // Additional release content.
+ CustomSummary template.HTML // CustomSummary, if non-empty, replaces the entire release content summary with custom HTML.
+}
+
+// A Version is a Go release version.
+//
+// In contrast to Semantic Versioning 2.0.0,
+// trailing zero components are omitted,
+// a version like Go 1.14 is considered a major Go release,
+// a version like Go 1.14.1 is considered a minor Go release.
+//
+// See proposal golang.org/issue/32450 for background, details,
+// and a discussion of the costs involved in making a change.
+type Version struct {
+ X int // X is the 1st component of a Go X.Y.Z version. It must be 1 or higher.
+ Y int // Y is the 2nd component of a Go X.Y.Z version. It must be 0 or higher.
+ Z int // Z is the 3rd component of a Go X.Y.Z version. It must be 0 or higher.
+}
+
+// String returns the Go release version string,
+// like "1.14", "1.14.1", "1.14.2", and so on.
+func (v Version) String() string {
+ switch {
+ case v.Z != 0:
+ return fmt.Sprintf("%d.%d.%d", v.X, v.Y, v.Z)
+ case v.Y != 0:
+ return fmt.Sprintf("%d.%d", v.X, v.Y)
+ default:
+ return fmt.Sprintf("%d", v.X)
+ }
+}
+
+func (v Version) Before(u Version) bool {
+ if v.X != u.X {
+ return v.X < u.X
+ }
+ if v.Y != u.Y {
+ return v.Y < u.Y
+ }
+ return v.Z < u.Z
+}
+
+// IsMajor reports whether version v is considered to be a major Go release.
+// For example, Go 1.14 and 1.13 are major Go releases.
+func (v Version) IsMajor() bool { return v.Z == 0 }
+
+// IsMinor reports whether version v is considered to be a minor Go release.
+// For example, Go 1.14.1 and 1.13.9 are minor Go releases.
+func (v Version) IsMinor() bool { return v.Z != 0 }
+
+// A Date represents the date (year, month, day) of a Go release.
+//
+// This type does not include location information, and
+// therefore does not describe a unique 24-hour timespan.
+type Date struct {
+ Year int // Year (e.g., 2009).
+ Month time.Month // Month of the year (January = 1, ...).
+ Day int // Day of the month, starting at 1.
+}
+
+func (d Date) String() string {
+ return d.Format("2006-01-02")
+}
+
+func (d Date) Format(format string) string {
+ return time.Date(d.Year, d.Month, d.Day, 0, 0, 0, 0, time.UTC).Format(format)
+}
+
+// A Major describes a major Go release and its minor revisions.
+type Major struct {
+ *Release
+ Minor []*Release // oldest first
+}
+
+var Majors []*Major = majors() // major versions, newest first
+
+// majors returns a list of major versions, sorted newest first.
+func majors() []*Major {
+ byVersion := make(map[Version]*Major)
+ for _, r := range Releases {
+ v := r.Version
+ v.Z = 0 // make major version
+ m := byVersion[v]
+ if m == nil {
+ m = new(Major)
+ byVersion[v] = m
+ }
+ if r.Version.Z == 0 {
+ m.Release = r
+ } else {
+ m.Minor = append(m.Minor, r)
+ }
+ }
+
+ var majors []*Major
+ for _, m := range byVersion {
+ majors = append(majors, m)
+ // minors oldest first
+ sort.Slice(m.Minor, func(i, j int) bool {
+ return m.Minor[i].Version.Before(m.Minor[j].Version)
+ })
+ }
+ // majors newest first
+ sort.Slice(majors, func(i, j int) bool {
+ return !majors[i].Version.Before(majors[j].Version)
+ })
+ return majors
+}
+
+// ComponentsAndPackages joins components and packages involved
+// in a Go release for the purposes of being displayed on the
+// release history page, keeping English grammar rules in mind.
+//
+// The different special cases are:
+//
+// c1
+// c1 and c2
+// c1, c2, and c3
+//
+// the p1 package
+// the p1 and p2 packages
+// the p1, p2, and p3 packages
+//
+// c1 and [1 package]
+// c1, and [2 or more packages]
+// c1, c2, and [1 or more packages]
+//
+func (r *Release) ComponentsAndPackages() template.HTML {
+ var buf strings.Builder
+
+ // List components, if any.
+ for i, comp := range r.Components {
+ if len(r.Packages) == 0 {
+ // No packages, so components are joined with more rules.
+ switch {
+ case i != 0 && len(r.Components) == 2:
+ buf.WriteString(" and ")
+ case i != 0 && len(r.Components) >= 3 && i != len(r.Components)-1:
+ buf.WriteString(", ")
+ case i != 0 && len(r.Components) >= 3 && i == len(r.Components)-1:
+ buf.WriteString(", and ")
+ }
+ } else {
+ // When there are packages, all components are comma-separated.
+ if i != 0 {
+ buf.WriteString(", ")
+ }
+ }
+ buf.WriteString(string(comp))
+ }
+
+ // Join components and packages using a comma and/or "and" as needed.
+ if len(r.Components) > 0 && len(r.Packages) > 0 {
+ if len(r.Components)+len(r.Packages) >= 3 {
+ buf.WriteString(",")
+ }
+ buf.WriteString(" and ")
+ }
+
+ // List packages, if any.
+ if len(r.Packages) > 0 {
+ buf.WriteString("the ")
+ }
+ for i, pkg := range r.Packages {
+ switch {
+ case i != 0 && len(r.Packages) == 2:
+ buf.WriteString(" and ")
+ case i != 0 && len(r.Packages) >= 3 && i != len(r.Packages)-1:
+ buf.WriteString(", ")
+ case i != 0 && len(r.Packages) >= 3 && i == len(r.Packages)-1:
+ buf.WriteString(", and ")
+ }
+ buf.WriteString("<code>" + html.EscapeString(pkg) + "</code>")
+ }
+ switch {
+ case len(r.Packages) == 1:
+ buf.WriteString(" package")
+ case len(r.Packages) >= 2:
+ buf.WriteString(" packages")
+ }
+
+ return template.HTML(buf.String())
+}
diff --git a/internal/history/release.go b/internal/history/release.go
index c97737f..1459eeb 100644
--- a/internal/history/release.go
+++ b/internal/history/release.go
@@ -5,35 +5,17 @@
// Package history stores historical data for the Go project.
package history
-import (
- "fmt"
- "html/template"
- "time"
-)
-
-// Release contains release metadata and a summary of release content.
-type Release struct {
- // Release metadata.
- Date Date // Date of the release.
- Security bool // Security release.
- Future bool // Future is whether the release hasn't happened yet.
-
- // Release content summary.
- Quantifier string // Optional quantifier. Empty string for unspecified amount of fixes (typical), "a" for a single fix, "two", "three" for multiple fixes, etc.
- Components []template.HTML // Components involved. For example, "cgo", "the <code>go</code> command", "the runtime", etc.
- Packages []string // Packages involved. For example, "net/http", "crypto/x509", etc.
- More template.HTML // Additional release content.
- CustomSummary template.HTML // CustomSummary, if non-empty, replaces the entire release content summary with custom HTML.
-}
+import "html/template"
// Releases summarizes the changes between official stable releases of Go.
+// It contains entries for all releases of Go, but releases older than Go 1.9
+// omit information about minor versions, which is instead hard-coded in
+// _content/doc/devel/release.html.
//
-// It contains entries for releases of Go 1.9 and newer.
-// Older releases are listed in doc/devel/release.html.
-var Releases = map[GoVer]Release{
- {1, 16, 4}: {
- Date: Date{2021, 5, 6},
-
+// The table is sorted by date, breaking ties with newer versions first.
+var Releases = []*Release{
+ {
+ Date: Date{2021, 5, 6}, Version: Version{1, 16, 4},
CustomSummary: `includes a security fix to the
<code>net/http</code> package, as well as bug fixes to the runtime,
the compiler, and the <code>archive/zip</code>, <code>time</code>,
@@ -41,524 +23,387 @@
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.16.4+label%3ACherryPickApproved">Go
1.16.4 milestone</a> on our issue tracker for details.`,
},
- {1, 15, 12}: {
- Date: Date{2021, 5, 6},
-
+ {
+ Date: Date{2021, 5, 6}, Version: Version{1, 15, 12},
CustomSummary: `includes a security fix to the
-<code>net/http</code> package, as well as bug fixes to the runtime and
-the <code>time</code> package. See the
-<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.15.12+label%3ACherryPickApproved">Go
-1.15.12 milestone</a> on our issue tracker for details.`,
+<code>net/http</code> package, as well as bug fixes to the runtime,
+the compiler, and the <code>archive/zip</code>, <code>time</code>,
+and <code>syscall</code> packages. See the
+<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.16.4+label%3ACherryPickApproved">Go
+1.16.4 milestone</a> on our issue tracker for details.`,
},
-
- {1, 16, 3}: {
- Date: Date{2021, 4, 1},
-
+ {
+ Date: Date{2021, 4, 1}, Version: Version{1, 16, 3},
Components: []template.HTML{"the compiler", "linker", "runtime", "the <code>go</code> command"},
Packages: []string{"testing", "time"},
},
- {1, 15, 11}: {
- Date: Date{2021, 4, 1},
-
+ {
+ Date: Date{2021, 4, 1}, Version: Version{1, 15, 11},
Components: []template.HTML{"cgo", "the compiler", "linker", "runtime", "the <code>go</code> command"},
Packages: []string{"database/sql", "net/http"},
},
-
- {1, 16, 2}: {
- Date: Date{2021, 3, 11},
-
+ {
+ Date: Date{2021, 3, 11}, Version: Version{1, 16, 2},
Components: []template.HTML{"cgo", "the compiler", "linker", "the <code>go</code> command"},
Packages: []string{"syscall", "time"},
},
- {1, 15, 10}: {
- Date: Date{2021, 3, 11},
-
+ {
+ Date: Date{2021, 3, 11}, Version: Version{1, 15, 10},
Components: []template.HTML{"the compiler", "the <code>go</code> command"},
Packages: []string{"net/http", "os", "syscall", "time"},
},
-
- {1, 16, 1}: {
- Date: Date{2021, 3, 10},
- Security: true,
-
+ {
+ Date: Date{2021, 3, 10}, Version: Version{1, 16, 1}, Security: true,
Packages: []string{"archive/zip", "encoding/xml"},
},
- {1, 15, 9}: {
- Date: Date{2021, 3, 10},
- Security: true,
-
+ {
+ Date: Date{2021, 3, 10}, Version: Version{1, 15, 9}, Security: true,
Packages: []string{"encoding/xml"},
},
-
- {1, 16, 0}: {
- Date: Date{2021, 2, 16},
+ {
+ Date: Date{2021, 2, 16}, Version: Version{1, 16, 0},
},
-
- {1, 15, 8}: {
- Date: Date{2021, 2, 4},
-
+ {
+ Date: Date{2021, 2, 4}, Version: Version{1, 15, 8},
Components: []template.HTML{"the compiler", "linker", "runtime", "the <code>go</code> command"},
Packages: []string{"net/http"},
},
- {1, 14, 15}: {
- Date: Date{2021, 2, 4},
-
+ {
+ Date: Date{2021, 2, 4}, Version: Version{1, 14, 15},
Components: []template.HTML{"the compiler", "runtime", "the <code>go</code> command"},
Packages: []string{"net/http"},
},
-
- {1, 15, 7}: {
- Date: Date{2021, 1, 19},
- Security: true,
-
+ {
+ Date: Date{2021, 1, 19}, Version: Version{1, 15, 7}, Security: true,
Components: []template.HTML{"the <code>go</code> command"},
Packages: []string{"crypto/elliptic"},
},
- {1, 14, 14}: {
- Date: Date{2021, 1, 19},
- Security: true,
-
+ {
+ Date: Date{2021, 1, 19}, Version: Version{1, 14, 14}, Security: true,
Components: []template.HTML{"the <code>go</code> command"},
Packages: []string{"crypto/elliptic"},
},
-
- {1, 15, 6}: {
- Date: Date{2020, 12, 3},
-
+ {
+ Date: Date{2020, 12, 3}, Version: Version{1, 15, 6},
Components: []template.HTML{"the compiler", "linker", "runtime", "the <code>go</code> command"},
Packages: []string{"io"},
},
- {1, 14, 13}: {
- Date: Date{2020, 12, 3},
-
+ {
+ Date: Date{2020, 12, 3}, Version: Version{1, 14, 13},
Components: []template.HTML{"the compiler", "runtime", "the <code>go</code> command"},
},
-
- {1, 15, 5}: {
- Date: Date{2020, 11, 12},
- Security: true,
-
+ {
+ Date: Date{2020, 11, 12}, Version: Version{1, 15, 5}, Security: true,
Components: []template.HTML{"the <code>go</code> command"},
Packages: []string{"math/big"},
},
- {1, 14, 12}: {
- Date: Date{2020, 11, 12},
- Security: true,
-
+ {
+ Date: Date{2020, 11, 12}, Version: Version{1, 14, 12}, Security: true,
Components: []template.HTML{"the <code>go</code> command"},
Packages: []string{"math/big"},
},
-
- {1, 15, 4}: {
- Date: Date{2020, 11, 5},
-
+ {
+ Date: Date{2020, 11, 5}, Version: Version{1, 15, 4},
Components: []template.HTML{"cgo", "the compiler", "linker", "runtime"},
Packages: []string{"compress/flate", "net/http", "reflect", "time"},
},
- {1, 14, 11}: {
- Date: Date{2020, 11, 5},
-
+ {
+ Date: Date{2020, 11, 5}, Version: Version{1, 14, 11},
Components: []template.HTML{"the runtime"},
Packages: []string{"net/http", "time"},
},
-
- {1, 15, 3}: {
- Date: Date{2020, 10, 14},
-
+ {
+ Date: Date{2020, 10, 14}, Version: Version{1, 15, 3},
Components: []template.HTML{"cgo", "the compiler", "runtime", "the <code>go</code> command"},
Packages: []string{"bytes", "plugin", "testing"},
},
- {1, 14, 10}: {
- Date: Date{2020, 10, 14},
-
+ {
+ Date: Date{2020, 10, 14}, Version: Version{1, 14, 10},
Components: []template.HTML{"the compiler", "runtime"},
Packages: []string{"plugin", "testing"},
},
-
- {1, 15, 2}: {
- Date: Date{2020, 9, 9},
-
+ {
+ Date: Date{2020, 9, 9}, Version: Version{1, 15, 2},
Components: []template.HTML{"the compiler", "runtime", "documentation", "the <code>go</code> command"},
Packages: []string{"net/mail", "os", "sync", "testing"},
},
- {1, 14, 9}: {
- Date: Date{2020, 9, 9},
-
+ {
+ Date: Date{2020, 9, 9}, Version: Version{1, 14, 9},
Components: []template.HTML{"the compiler", "linker", "runtime", "documentation"},
Packages: []string{"net/http", "testing"},
},
-
- {1, 15, 1}: {
- Date: Date{2020, 9, 1},
- Security: true,
-
+ {
+ Date: Date{2020, 9, 1}, Version: Version{1, 15, 1}, Security: true,
Packages: []string{"net/http/cgi", "net/http/fcgi"},
},
- {1, 14, 8}: {
- Date: Date{2020, 9, 1},
- Security: true,
-
+ {
+ Date: Date{2020, 9, 1}, Version: Version{1, 14, 8}, Security: true,
Packages: []string{"net/http/cgi", "net/http/fcgi"},
},
-
- {1, 15, 0}: {
- Date: Date{2020, 8, 11},
+ {
+ Date: Date{2020, 8, 11}, Version: Version{1, 15, 0},
},
-
- {1, 14, 7}: {
- Date: Date{2020, 8, 6},
- Security: true,
-
+ {
+ Date: Date{2020, 8, 6}, Version: Version{1, 14, 7}, Security: true,
Packages: []string{"encoding/binary"},
},
- {1, 13, 15}: {
- Date: Date{2020, 8, 6},
- Security: true,
-
+ {
+ Date: Date{2020, 8, 6}, Version: Version{1, 13, 15}, Security: true,
Packages: []string{"encoding/binary"},
},
-
- {1, 14, 6}: {
- Date: Date{2020, 7, 16},
-
+ {
+ Date: Date{2020, 7, 16}, Version: Version{1, 14, 6},
Components: []template.HTML{"the <code>go</code> command", "the compiler", "the linker", "vet"},
Packages: []string{"database/sql", "encoding/json", "net/http", "reflect", "testing"},
},
- {1, 13, 14}: {
- Date: Date{2020, 7, 16},
-
+ {
+ Date: Date{2020, 7, 16}, Version: Version{1, 13, 14},
Components: []template.HTML{"the compiler", "vet"},
Packages: []string{"database/sql", "net/http", "reflect"},
},
-
- {1, 14, 5}: {
- Date: Date{2020, 7, 14},
- Security: true,
-
+ {
+ Date: Date{2020, 7, 14}, Version: Version{1, 14, 5}, Security: true,
Packages: []string{"crypto/x509", "net/http"},
},
- {1, 13, 13}: {
- Date: Date{2020, 7, 14},
- Security: true,
-
+ {
+ Date: Date{2020, 7, 14}, Version: Version{1, 13, 13}, Security: true,
Packages: []string{"crypto/x509", "net/http"},
},
-
- {1, 14, 4}: {
- Date: Date{2020, 6, 1},
-
+ {
+ Date: Date{2020, 6, 1}, Version: Version{1, 14, 4},
Components: []template.HTML{"the <code>go</code> <code>doc</code> command", "the runtime"},
Packages: []string{"encoding/json", "os"},
},
- {1, 13, 12}: {
- Date: Date{2020, 6, 1},
-
+ {
+ Date: Date{2020, 6, 1}, Version: Version{1, 13, 12},
Components: []template.HTML{"the runtime"},
Packages: []string{"go/types", "math/big"},
},
-
- {1, 14, 3}: {
- Date: Date{2020, 5, 14},
-
+ {
+ Date: Date{2020, 5, 14}, Version: Version{1, 14, 3},
Components: []template.HTML{"cgo", "the compiler", "the runtime"},
Packages: []string{"go/doc", "math/big"},
},
- {1, 13, 11}: {
- Date: Date{2020, 5, 14},
-
+ {
+ Date: Date{2020, 5, 14}, Version: Version{1, 13, 11},
Components: []template.HTML{"the compiler"},
},
-
- {1, 14, 2}: {
- Date: Date{2020, 4, 8},
-
+ {
+ Date: Date{2020, 4, 8}, Version: Version{1, 14, 2},
Components: []template.HTML{"cgo", "the go command", "the runtime"},
Packages: []string{"os/exec", "testing"},
},
- {1, 13, 10}: {
- Date: Date{2020, 4, 8},
-
+ {
+ Date: Date{2020, 4, 8}, Version: Version{1, 13, 10},
Components: []template.HTML{"the go command", "the runtime"},
Packages: []string{"os/exec", "time"},
},
-
- {1, 14, 1}: {
- Date: Date{2020, 3, 19},
-
+ {
+ Date: Date{2020, 3, 19}, Version: Version{1, 14, 1},
Components: []template.HTML{"the go command", "tools", "the runtime"},
},
- {1, 13, 9}: {
- Date: Date{2020, 3, 19},
-
+ {
+ Date: Date{2020, 3, 19}, Version: Version{1, 13, 9},
Components: []template.HTML{"the go command", "tools", "the runtime", "the toolchain"},
Packages: []string{"crypto/cypher"},
},
-
- {1, 14, 0}: {
- Date: Date{2020, 2, 25},
+ {
+ Date: Date{2020, 2, 25}, Version: Version{1, 14, 0},
},
-
- {1, 13, 8}: {
- Date: Date{2020, 2, 12},
-
+ {
+ Date: Date{2020, 2, 12}, Version: Version{1, 13, 8},
Components: []template.HTML{"the runtime"},
Packages: []string{"crypto/x509", "net/http"},
},
- {1, 12, 17}: {
- Date: Date{2020, 2, 12},
-
+ {
+ Date: Date{2020, 2, 12}, Version: Version{1, 12, 17},
Quantifier: "a",
Components: []template.HTML{"the runtime"},
},
-
- {1, 13, 7}: {
- Date: Date{2020, 1, 28},
- Security: true,
-
+ {
+ Date: Date{2020, 1, 28}, Version: Version{1, 13, 7}, Security: true,
Quantifier: "two",
Packages: []string{"crypto/x509"},
},
- {1, 12, 16}: {
- Date: Date{2020, 1, 28},
- Security: true,
-
+ {
+ Date: Date{2020, 1, 28}, Version: Version{1, 12, 16}, Security: true,
Quantifier: "two",
Packages: []string{"crypto/x509"},
},
-
- {1, 13, 6}: {
- Date: Date{2020, 1, 9},
-
+ {
+ Date: Date{2020, 1, 9}, Version: Version{1, 13, 6},
Components: []template.HTML{"the runtime"},
Packages: []string{"net/http"},
},
- {1, 12, 15}: {
- Date: Date{2020, 1, 9},
-
+ {
+ Date: Date{2020, 1, 9}, Version: Version{1, 12, 15},
Components: []template.HTML{"the runtime"},
Packages: []string{"net/http"},
},
-
- {1, 13, 5}: {
- Date: Date{2019, 12, 4},
-
+ {
+ Date: Date{2019, 12, 4}, Version: Version{1, 13, 5},
Components: []template.HTML{"the go command", "the runtime", "the linker"},
Packages: []string{"net/http"},
},
- {1, 12, 14}: {
- Date: Date{2019, 12, 4},
-
+ {
+ Date: Date{2019, 12, 4}, Version: Version{1, 12, 14},
Quantifier: "a",
Components: []template.HTML{"the runtime"},
},
-
- {1, 13, 4}: {
- Date: Date{2019, 10, 31},
-
+ {
+ Date: Date{2019, 10, 31}, Version: Version{1, 13, 4},
Packages: []string{"net/http", "syscall"},
More: `It also fixes an issue on macOS 10.15 Catalina
where the non-notarized installer and binaries were being
<a href="https://golang.org/issue/34986">rejected by Gatekeeper</a>.`,
},
- {1, 12, 13}: {
- Date: Date{2019, 10, 31},
-
+ {
+ Date: Date{2019, 10, 31}, Version: Version{1, 12, 13},
CustomSummary: `fixes an issue on macOS 10.15 Catalina
where the non-notarized installer and binaries were being
<a href="https://golang.org/issue/34986">rejected by Gatekeeper</a>.
Only macOS users who hit this issue need to update.`,
},
-
- {1, 13, 3}: {
- Date: Date{2019, 10, 17},
-
+ {
+ Date: Date{2019, 10, 17}, Version: Version{1, 13, 3},
Components: []template.HTML{"the go command", "the toolchain", "the runtime"},
Packages: []string{"syscall", "net", "net/http", "crypto/ecdsa"},
},
- {1, 12, 12}: {
- Date: Date{2019, 10, 17},
-
+ {
+ Date: Date{2019, 10, 17}, Version: Version{1, 12, 12},
Components: []template.HTML{"the go command", "runtime"},
Packages: []string{"syscall", "net"},
},
-
- {1, 13, 2}: {
- Date: Date{2019, 10, 17},
- Security: true,
-
+ {
+ Date: Date{2019, 10, 17}, Version: Version{1, 13, 2}, Security: true,
Components: []template.HTML{"the compiler"},
Packages: []string{"crypto/dsa"},
},
- {1, 12, 11}: {
- Date: Date{2019, 10, 17},
- Security: true,
-
+ {
+ Date: Date{2019, 10, 17}, Version: Version{1, 12, 11}, Security: true,
Packages: []string{"crypto/dsa"},
},
-
- {1, 13, 1}: {
- Date: Date{2019, 9, 25},
- Security: true,
-
+ {
+ Date: Date{2019, 9, 25}, Version: Version{1, 13, 1}, Security: true,
Packages: []string{"net/http", "net/textproto"},
},
- {1, 12, 10}: {
- Date: Date{2019, 9, 25},
- Security: true,
-
+ {
+ Date: Date{2019, 9, 25}, Version: Version{1, 12, 10}, Security: true,
Packages: []string{"net/http", "net/textproto"},
},
-
- {1, 13, 0}: {
- Date: Date{2019, 9, 3},
+ {
+ Date: Date{2019, 9, 3}, Version: Version{1, 13, 0},
},
-
- {1, 12, 9}: {
- Date: Date{2019, 8, 15},
-
+ {
+ Date: Date{2019, 8, 15}, Version: Version{1, 12, 9},
Components: []template.HTML{"the linker"},
Packages: []string{"os", "math/big"},
},
-
- {1, 12, 8}: {
- Date: Date{2019, 8, 13},
- Security: true,
-
+ {
+ Date: Date{2019, 8, 13}, Version: Version{1, 12, 8}, Security: true,
Packages: []string{"net/http", "net/url"},
},
- {1, 11, 13}: {
- Date: Date{2019, 8, 13},
- Security: true,
-
+ {
+ Date: Date{2019, 8, 13}, Version: Version{1, 11, 13}, Security: true,
Packages: []string{"net/http", "net/url"},
},
-
- {1, 12, 7}: {
- Date: Date{2019, 7, 8},
-
+ {
+ Date: Date{2019, 7, 8}, Version: Version{1, 12, 7},
Components: []template.HTML{"cgo", "the compiler", "the linker"},
},
- {1, 11, 12}: {
- Date: Date{2019, 7, 8},
-
+ {
+ Date: Date{2019, 7, 8}, Version: Version{1, 11, 12},
Components: []template.HTML{"the compiler", "the linker"},
},
-
- {1, 12, 6}: {
- Date: Date{2019, 6, 11},
-
+ {
+ Date: Date{2019, 6, 11}, Version: Version{1, 12, 6},
Components: []template.HTML{"the compiler", "the linker", "the go command"},
Packages: []string{"crypto/x509", "net/http", "os"},
},
- {1, 11, 11}: {
- Date: Date{2019, 6, 11},
-
+ {
+ Date: Date{2019, 6, 11}, Version: Version{1, 11, 11},
Quantifier: "a",
Packages: []string{"crypto/x509"},
},
-
- {1, 12, 5}: {
- Date: Date{2019, 5, 6},
-
+ {
+ Date: Date{2019, 5, 6}, Version: Version{1, 12, 5},
Components: []template.HTML{"the compiler", "the linker", "the go command", "the runtime"},
Packages: []string{"os"},
},
- {1, 11, 10}: {
- Date: Date{2019, 5, 6},
-
+ {
+ Date: Date{2019, 5, 6}, Version: Version{1, 11, 10},
Components: []template.HTML{"the runtime", "the linker"},
},
-
- {1, 12, 4}: {
- Date: Date{2019, 4, 11},
-
+ {
+ Date: Date{2019, 4, 11}, Version: Version{1, 12, 4},
CustomSummary: `fixes an issue where using the prebuilt binary
releases on older versions of GNU/Linux
<a href="https://golang.org/issues/31293">led to failures</a>
when linking programs that used cgo.
Only Linux users who hit this issue need to update.`,
},
- {1, 11, 9}: {
- Date: Date{2019, 4, 11},
-
+ {
+ Date: Date{2019, 4, 11}, Version: Version{1, 11, 9},
CustomSummary: `fixes an issue where using the prebuilt binary
releases on older versions of GNU/Linux
<a href="https://golang.org/issues/31293">led to failures</a>
when linking programs that used cgo.
Only Linux users who hit this issue need to update.`,
},
-
- {1, 12, 3}: {
- Date: Date{2019, 4, 8},
-
+ {
+ Date: Date{2019, 4, 8}, Version: Version{1, 12, 3},
CustomSummary: `was accidentally released without its
intended fix. It is identical to go1.12.2, except for its version
number. The intended fix is in go1.12.4.`,
},
- {1, 11, 8}: {
- Date: Date{2019, 4, 8},
-
+ {
+ Date: Date{2019, 4, 8}, Version: Version{1, 11, 8},
CustomSummary: `was accidentally released without its
intended fix. It is identical to go1.11.7, except for its version
number. The intended fix is in go1.11.9.`,
},
-
- {1, 12, 2}: {
- Date: Date{2019, 4, 5},
-
+ {
+ Date: Date{2019, 4, 5}, Version: Version{1, 12, 2},
Components: []template.HTML{"the compiler", "the go command", "the runtime"},
Packages: []string{"doc", "net", "net/http/httputil", "os"},
},
- {1, 11, 7}: {
- Date: Date{2019, 4, 5},
-
+ {
+ Date: Date{2019, 4, 5}, Version: Version{1, 11, 7},
Components: []template.HTML{"the runtime"},
Packages: []string{"net"},
},
-
- {1, 12, 1}: {
- Date: Date{2019, 3, 14},
-
+ {
+ Date: Date{2019, 3, 14}, Version: Version{1, 12, 1},
Components: []template.HTML{"cgo", "the compiler", "the go command"},
Packages: []string{"fmt", "net/smtp", "os", "path/filepath", "sync", "text/template"},
},
- {1, 11, 6}: {
- Date: Date{2019, 3, 14},
-
+ {
+ Date: Date{2019, 3, 14}, Version: Version{1, 11, 6},
Components: []template.HTML{"cgo", "the compiler", "linker", "runtime", "go command"},
Packages: []string{"crypto/x509", "encoding/json", "net", "net/url"},
},
-
- {1, 12, 0}: {
- Date: Date{2019, 2, 25},
+ {
+ Date: Date{2019, 2, 25}, Version: Version{1, 12, 0},
},
-
- {1, 11, 5}: {
- Date: Date{2019, 1, 23},
- Security: true,
-
+ {
+ Date: Date{2019, 1, 23}, Version: Version{1, 11, 5}, Security: true,
Quantifier: "a",
Packages: []string{"crypto/elliptic"},
},
- {1, 10, 8}: {
- Date: Date{2019, 1, 23},
- Security: true,
-
+ {
+ Date: Date{2019, 1, 23}, Version: Version{1, 10, 8}, Security: true,
Quantifier: "a",
Packages: []string{"crypto/elliptic"},
},
-
- {1, 11, 4}: {
- Date: Date{2018, 12, 14},
-
+ {
+ Date: Date{2018, 12, 14}, Version: Version{1, 11, 4},
Components: []template.HTML{"cgo", "the compiler", "linker", "runtime", "documentation", "go command"},
Packages: []string{"net/http", "go/types"},
More: `It includes a fix to a bug introduced in Go 1.11.3 that broke <code>go</code>
<code>get</code> for import path patterns containing "<code>...</code>".`,
},
- {1, 10, 7}: {
- Date: Date{2018, 12, 14},
-
+ {
+ Date: Date{2018, 12, 14}, Version: Version{1, 10, 7},
// TODO: Modify to follow usual pattern, say it includes a fix to the go command.
CustomSummary: `includes a fix to a bug introduced in Go 1.10.6
that broke <code>go</code> <code>get</code> for import path patterns containing
@@ -566,178 +411,129 @@
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.7+label%3ACherryPickApproved">
Go 1.10.7 milestone</a> on our issue tracker for details.`,
},
-
- {1, 11, 3}: {
- Date: Date{2018, 12, 12},
- Security: true,
-
+ {
+ Date: Date{2018, 12, 12}, Version: Version{1, 11, 3}, Security: true,
Quantifier: "three",
Components: []template.HTML{`"go get"`},
Packages: []string{"crypto/x509"},
},
- {1, 10, 6}: {
- Date: Date{2018, 12, 12},
- Security: true,
-
+ {
+ Date: Date{2018, 12, 12}, Version: Version{1, 10, 6}, Security: true,
Quantifier: "three",
Components: []template.HTML{`"go get"`},
Packages: []string{"crypto/x509"},
More: "It contains the same fixes as Go 1.11.3 and was released at the same time.",
},
-
- {1, 11, 2}: {
- Date: Date{2018, 11, 2},
-
+ {
+ Date: Date{2018, 11, 2}, Version: Version{1, 11, 2},
Components: []template.HTML{"the compiler", "linker", "documentation", "go command"},
Packages: []string{"database/sql", "go/types"},
},
- {1, 10, 5}: {
- Date: Date{2018, 11, 2},
-
+ {
+ Date: Date{2018, 11, 2}, Version: Version{1, 10, 5},
Components: []template.HTML{"the go command", "linker", "runtime"},
Packages: []string{"database/sql"},
},
-
- {1, 11, 1}: {
- Date: Date{2018, 10, 1},
-
+ {
+ Date: Date{2018, 10, 1}, Version: Version{1, 11, 1},
Components: []template.HTML{"the compiler", "documentation", "go command", "runtime"},
Packages: []string{"crypto/x509", "encoding/json", "go/types", "net", "net/http", "reflect"},
},
-
- {1, 11, 0}: {
- Date: Date{2018, 8, 24},
+ {
+ Date: Date{2018, 8, 24}, Version: Version{1, 11, 0},
},
- {1, 10, 4}: {
- Date: Date{2018, 8, 24},
-
+ {
+ Date: Date{2018, 8, 24}, Version: Version{1, 10, 4},
Components: []template.HTML{"the go command", "linker"},
Packages: []string{"net/http", "mime/multipart", "ld/macho", "bytes", "strings"},
},
-
- {1, 10, 3}: {
- Date: Date{2018, 6, 5},
-
+ {
+ Date: Date{2018, 6, 5}, Version: Version{1, 10, 3},
Components: []template.HTML{"the go command"},
Packages: []string{"crypto/tls", "crypto/x509", "strings"},
More: `In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.`,
},
- {1, 9, 7}: {
- Date: Date{2018, 6, 5},
-
+ {
+ Date: Date{2018, 6, 5}, Version: Version{1, 9, 7},
Components: []template.HTML{"the go command"},
Packages: []string{"crypto/x509", "strings"},
More: `In particular, it adds <a href="https://go.googlesource.com/go/+/d4e21288e444d3ffd30d1a0737f15ea3fc3b8ad9">
minimal support to the go command for the vgo transition</a>.`,
},
-
- {1, 10, 2}: {
- Date: Date{2018, 5, 1},
-
+ {
+ Date: Date{2018, 5, 1}, Version: Version{1, 10, 2},
Components: []template.HTML{"the compiler", "linker", "go command"},
},
- {1, 9, 6}: {
- Date: Date{2018, 5, 1},
-
+ {
+ Date: Date{2018, 5, 1}, Version: Version{1, 9, 6},
Components: []template.HTML{"the compiler", "go command"},
},
-
- {1, 10, 1}: {
- Date: Date{2018, 3, 28},
-
+ {
+ Date: Date{2018, 3, 28}, Version: Version{1, 10, 1},
Components: []template.HTML{"the compiler", "runtime"},
Packages: []string{"archive/zip", "crypto/tls", "crypto/x509", "encoding/json", "net", "net/http", "net/http/pprof"},
},
- {1, 9, 5}: {
- Date: Date{2018, 3, 28},
-
+ {
+ Date: Date{2018, 3, 28}, Version: Version{1, 9, 5},
Components: []template.HTML{"the compiler", "go command"},
Packages: []string{"net/http/pprof"},
},
-
- {1, 10, 0}: {
- Date: Date{2018, 2, 16},
+ {
+ Date: Date{2018, 2, 16}, Version: Version{1, 10, 0},
},
-
- {1, 9, 4}: {
- Date: Date{2018, 2, 7},
- Security: true,
-
+ {
+ Date: Date{2018, 2, 7}, Version: Version{1, 9, 4}, Security: true,
Quantifier: "a",
Components: []template.HTML{`"go get"`},
},
-
- {1, 9, 3}: {
- Date: Date{2018, 1, 22},
-
+ {
+ Date: Date{2018, 1, 22}, Version: Version{1, 9, 3},
Components: []template.HTML{"the compiler", "runtime"},
Packages: []string{"database/sql", "math/big", "net/http", "net/url"},
},
-
- {1, 9, 2}: {
- Date: Date{2017, 10, 25},
-
+ {
+ Date: Date{2017, 10, 25}, Version: Version{1, 9, 2},
Components: []template.HTML{"the compiler", "linker", "runtime", "documentation", "<code>go</code> command"},
Packages: []string{"crypto/x509", "database/sql", "log", "net/smtp"},
More: `It includes a fix to a bug introduced in Go 1.9.1 that broke <code>go</code> <code>get</code>
of non-Git repositories under certain conditions.`,
},
-
- {1, 9, 1}: {
- Date: Date{2017, 10, 4},
- Security: true,
-
+ {
+ Date: Date{2017, 10, 4}, Version: Version{1, 9, 1}, Security: true,
Quantifier: "two",
},
-
- {1, 9, 0}: {
- Date: Date{2017, 8, 24},
+ {
+ Date: Date{2017, 8, 24}, Version: Version{1, 9, 0},
},
-}
-// GoVer represents a Go release version.
-//
-// In contrast to Semantic Versioning 2.0.0,
-// trailing zero components are omitted,
-// a version like Go 1.14 is considered a major Go release,
-// a version like Go 1.14.1 is considered a minor Go release.
-//
-// See proposal golang.org/issue/32450 for background, details,
-// and a discussion of the costs involved in making a change.
-type GoVer struct {
- X int // X is the 1st component of a Go X.Y.Z version. It must be 1 or higher.
- Y int // Y is the 2nd component of a Go X.Y.Z version. It must be 0 or higher.
- Z int // Z is the 3rd component of a Go X.Y.Z version. It must be 0 or higher.
-}
-
-// String returns the Go release version string,
-// like "1.14", "1.14.1", "1.14.2", and so on.
-func (v GoVer) String() string {
- switch {
- case v.Z != 0:
- return fmt.Sprintf("%d.%d.%d", v.X, v.Y, v.Z)
- case v.Y != 0:
- return fmt.Sprintf("%d.%d", v.X, v.Y)
- default:
- return fmt.Sprintf("%d", v.X)
- }
-}
-
-// IsMajor reports whether version v is considered to be a major Go release.
-// For example, Go 1.14 and 1.13 are major Go releases.
-func (v GoVer) IsMajor() bool { return v.Z == 0 }
-
-// IsMinor reports whether version v is considered to be a minor Go release.
-// For example, Go 1.14.1 and 1.13.9 are minor Go releases.
-func (v GoVer) IsMinor() bool { return v.Z != 0 }
-
-// Date represents the date (year, month, day) of a Go release.
-//
-// This type does not include location information, and
-// therefore does not describe a unique 24-hour timespan.
-type Date struct {
- Year int // Year (e.g., 2009).
- Month time.Month // Month of the year (January = 1, ...).
- Day int // Day of the month, starting at 1.
+ // Older releases do not have point release information here.
+ // See _content/doc/devel/release.html.
+ {
+ Date: Date{2017, 2, 16}, Version: Version{1, 8, 0},
+ },
+ {
+ Date: Date{2016, 8, 15}, Version: Version{1, 7, 0},
+ },
+ {
+ Date: Date{2016, 2, 17}, Version: Version{1, 6, 0},
+ },
+ {
+ Date: Date{2015, 8, 19}, Version: Version{1, 5, 0},
+ },
+ {
+ Date: Date{2014, 12, 10}, Version: Version{1, 4, 0},
+ },
+ {
+ Date: Date{2014, 6, 18}, Version: Version{1, 3, 0},
+ },
+ {
+ Date: Date{2013, 12, 1}, Version: Version{1, 2, 0},
+ },
+ {
+ Date: Date{2013, 5, 13}, Version: Version{1, 1, 0},
+ },
+ {
+ Date: Date{2012, 3, 28}, Version: Version{1, 0, 0},
+ },
}
diff --git a/internal/history/release_test.go b/internal/history/release_test.go
new file mode 100644
index 0000000..d0759ca
--- /dev/null
+++ b/internal/history/release_test.go
@@ -0,0 +1,40 @@
+// Copyright 2021 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.
+
+package history
+
+import (
+ "testing"
+ "time"
+)
+
+func dateTime(d Date) time.Time {
+ return time.Date(d.Year, time.Month(d.Month), d.Day, 0, 0, 0, 0, time.UTC)
+}
+
+func TestReleases(t *testing.T) {
+ seen := make(map[Version]bool)
+ lastMinor := make(map[Version]int)
+ var last time.Time
+ for _, r := range Releases {
+ if seen[r.Version] {
+ t.Errorf("version %v duplicated", r.Version)
+ continue
+ }
+ seen[r.Version] = true
+ rt := dateTime(r.Date)
+ if !last.IsZero() && rt.After(last) {
+ t.Errorf("version %v out of order: %v vs %v", r.Version, r.Date, last.Format("2006-01-02"))
+ }
+ last = rt
+ major := r.Version
+ major.Z = 0
+ if z, ok := lastMinor[major]; ok && r.Version.Z != z-1 {
+ old := major
+ old.Z = z
+ t.Errorf("jumped from %v to %v", old, r.Version)
+ }
+ lastMinor[major] = r.Version.Z
+ }
+}