cmd/golangorg: change tests to use internal/webtest

Much shorter and clearer.
This also opens up the possibility of sharing
some tests between TestWeb and TestLiveServer.

Change-Id: Iaca004c88581b0e0d8c858333806f755cc140255
Reviewed-on: https://go-review.googlesource.com/c/website/+/321075
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
This commit is contained in:
Russ Cox 2021-05-18 14:59:01 -04:00
Родитель e5882a3721
Коммит fb64aa77f9
8 изменённых файлов: 1074 добавлений и 1372 удалений

Просмотреть файл

@ -10,18 +10,17 @@ package main_test
import (
"bytes"
"fmt"
"go/build"
"io/ioutil"
"net"
"net/http"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strings"
"testing"
"time"
"golang.org/x/website/internal/webtest"
)
// buildGodoc builds the godoc executable.
@ -75,24 +74,12 @@ func waitForServerReady(t *testing.T, addr string) {
waitForServer(t,
fmt.Sprintf("http://%v/", addr),
"The Go Programming Language",
15*time.Second,
false)
}
func waitUntilScanComplete(t *testing.T, addr string) {
waitForServer(t,
fmt.Sprintf("http://%v/pkg", addr),
"Scan is not yet complete",
2*time.Minute,
true,
)
// setting reverse as true, which means this waits
// until the string is not returned in the response anymore
15*time.Second)
}
const pollInterval = 200 * time.Millisecond
func waitForServer(t *testing.T, url, match string, timeout time.Duration, reverse bool) {
func waitForServer(t *testing.T, url, match string, timeout time.Duration) {
// "health check" duplicated from x/tools/cmd/tipgodoc/tip.go
deadline := time.Now().Add(timeout)
for time.Now().Before(deadline) {
@ -104,10 +91,7 @@ func waitForServer(t *testing.T, url, match string, timeout time.Duration, rever
rbody, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err == nil && res.StatusCode == http.StatusOK {
if bytes.Contains(rbody, []byte(match)) && !reverse {
return
}
if !bytes.Contains(rbody, []byte(match)) && reverse {
if bytes.Contains(rbody, []byte(match)) {
return
}
}
@ -115,17 +99,6 @@ func waitForServer(t *testing.T, url, match string, timeout time.Duration, rever
t.Fatalf("Server failed to respond in %v", timeout)
}
// hasTag checks whether a given release tag is contained in the current version
// of the go binary.
func hasTag(t string) bool {
for _, v := range build.Default.ReleaseTags {
if t == v {
return true
}
}
return false
}
func killAndWait(cmd *exec.Cmd) {
cmd.Process.Kill()
cmd.Wait()
@ -165,246 +138,6 @@ func testWeb(t *testing.T) {
defer killAndWait(cmd)
waitForServerReady(t, addr)
waitUntilScanComplete(t, addr)
tests := []struct {
path string
contains []string // substring
match []string // regexp
notContains []string
redirect string
releaseTag string // optional release tag that must be in go/build.ReleaseTags
}{
{
path: "/",
contains: []string{
"Go is an open source programming language",
"Binary distributions available for",
},
},
{
path: "/conduct",
contains: []string{"Project Stewards"},
},
{
path: "/doc/asm",
contains: []string{"Quick Guide", "Assembler"},
},
{
path: "/doc/gdb",
contains: []string{"Debugging Go Code"},
},
{
path: "/doc/debugging_with_gdb.html",
redirect: "/doc/gdb",
},
{
path: "/ref/spec",
contains: []string{"Go Programming Language Specification"},
},
{
path: "/doc/go_spec",
redirect: "/ref/spec",
},
{
path: "/doc/go_spec.html",
redirect: "/ref/spec",
},
{
path: "/doc/go_spec.md",
redirect: "/ref/spec",
},
{
path: "/ref/mem",
contains: []string{"Memory Model"},
},
{
path: "/doc/go_mem.html",
redirect: "/ref/mem",
},
{
path: "/doc/go_mem.md",
redirect: "/ref/mem",
},
{
path: "/doc/help.html",
redirect: "/help",
},
{
path: "/help/",
redirect: "/help",
},
{
path: "/help",
contains: []string{"Get help"},
},
{
path: "/pkg/fmt/",
contains: []string{"Package fmt implements formatted I/O"},
},
{
path: "/src/fmt/",
contains: []string{"scan_test.go"},
},
{
path: "/src/fmt/print.go",
contains: []string{"// Println formats using"},
},
{
path: "/pkg",
redirect: "/pkg/",
},
{
path: "/pkg/",
contains: []string{
"Standard library",
"Package fmt implements formatted I/O",
},
notContains: []string{
"internal/syscall",
"cmd/gc",
},
},
{
path: "/pkg/?m=all",
contains: []string{
"Standard library",
"Package fmt implements formatted I/O",
"internal/syscall/?m=all",
},
notContains: []string{
"cmd/gc",
},
},
{
path: "/pkg/strings/",
contains: []string{
`href="/src/strings/strings.go"`,
},
},
{
path: "/cmd/compile/internal/amd64/",
contains: []string{
`href="/src/cmd/compile/internal/amd64/ssa.go"`,
},
},
{
path: "/pkg/math/bits/",
contains: []string{
`Added in Go 1.9`,
},
},
{
path: "/pkg/net/",
contains: []string{
`// IPv6 scoped addressing zone; added in Go 1.1`,
},
},
{
path: "/pkg/net/http/httptrace/",
match: []string{
`Got1xxResponse.*// Go 1\.11`,
},
releaseTag: "go1.11",
},
// Verify we don't add version info to a struct field added the same time
// as the struct itself:
{
path: "/pkg/net/http/httptrace/",
match: []string{
`(?m)GotFirstResponseByte func\(\)\s*$`,
},
},
// Remove trailing periods before adding semicolons:
{
path: "/pkg/database/sql/",
contains: []string{
"The number of connections currently in use; added in Go 1.11",
"The number of idle connections; added in Go 1.11",
},
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>`,
},
},
{
path: "/doc/go1.16.html",
redirect: "/doc/go1.16",
},
{
path: "/doc/go1.16",
contains: []string{"Go 1.16"},
},
}
for _, test := range tests {
url := fmt.Sprintf("http://%s%s", addr, test.path)
var redirect string
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
redirect = strings.TrimPrefix(req.URL.String(), "http://"+addr)
return fmt.Errorf("not following redirects")
},
}
resp, err := client.Get(url)
if redirect != "" {
resp.Body.Close()
if test.redirect == "" {
t.Errorf("GET %s: unexpected redirect -> %s", url, redirect)
continue
}
if test.redirect != redirect {
t.Errorf("GET %s: redirect -> %s, want %s", url, redirect, test.redirect)
continue
}
continue
}
if err != nil {
t.Errorf("GET %s failed: %s", url, err)
continue
}
body, err := ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
t.Errorf("GET %s: failed to read body: %s (response: %v)", url, err, resp)
}
if test.redirect != "" {
t.Errorf("GET %s: have direct response, want redirect -> %s", url, test.redirect)
}
strBody := string(body)
isErr := false
for _, substr := range test.contains {
if test.releaseTag != "" && !hasTag(test.releaseTag) {
continue
}
if !bytes.Contains(body, []byte(substr)) {
t.Errorf("GET %s: wanted substring %q in body", url, substr)
isErr = true
}
}
for _, re := range test.match {
if test.releaseTag != "" && !hasTag(test.releaseTag) {
continue
}
if ok, err := regexp.MatchString(re, strBody); !ok || err != nil {
if err != nil {
t.Fatalf("Bad regexp %q: %v", re, err)
}
t.Errorf("GET %s: wanted to match %s in body", url, re)
isErr = true
}
}
for _, substr := range test.notContains {
if bytes.Contains(body, []byte(substr)) {
t.Errorf("GET %s: didn't want substring %q in body", url, substr)
isErr = true
}
}
if isErr {
t.Errorf("GET %s: got:\n%s", url, body)
}
}
webtest.TestServer(t, "testdata/web.txt", addr)
}

Просмотреть файл

@ -10,15 +10,11 @@
package main_test
import (
"bytes"
"flag"
"io"
"io/ioutil"
"net/http"
"net/url"
"regexp"
"strings"
"testing"
"golang.org/x/website/internal/webtest"
)
var host = flag.String("regtest.host", "", "host to run regression test against")
@ -28,166 +24,6 @@ func TestLiveServer(t *testing.T) {
if *host == "" {
t.Skip("regtest.host flag missing.")
}
substringTests := []struct {
Message string
Path string
Substring string
Regexp string
NoAnalytics bool // expect the response to not contain GA.
PostBody string
StatusCode int // if 0, expect 2xx status code.
}{
{
Path: "/doc/",
Substring: "an introduction to using modules in a simple project",
},
{
Path: "/conduct",
Substring: "Project Stewards",
},
{
Path: "/doc/faq",
Substring: "What is the purpose of the project",
},
{
Path: "/pkg/",
Substring: "Package tar",
},
{
Path: "/pkg/os/",
Substring: "func Open",
},
{
Path: "/pkg/net/http/",
Substring: `title="Added in Go 1.11"`,
Message: "version information not present - failed InitVersionInfo?",
},
{
Path: "/robots.txt",
Substring: "Disallow: /search",
Message: "robots not present - not deployed from Dockerfile?",
NoAnalytics: true,
},
{
Path: "/change/75944e2e3a63",
Substring: "bdb10cf",
Message: "no change redirect - hg to git mapping not registered?",
NoAnalytics: true,
StatusCode: 302,
},
{
Path: "/dl/",
Substring: `href="/dl/go1.11.windows-amd64.msi"`,
Message: "missing data on dl page - misconfiguration of datastore?",
},
{
Path: "/dl/?mode=json",
Substring: ".windows-amd64.msi",
NoAnalytics: true,
},
{
Message: "broken shortlinks - misconfiguration of datastore or memcache?",
Path: "/s/go2design",
Regexp: "proposal.*Found",
NoAnalytics: true,
StatusCode: 302,
},
{
Path: "/compile",
PostBody: "body=" + url.QueryEscape("package main; func main() { print(6*7); }"),
Regexp: `^{"compile_errors":"","output":"42"}$`,
NoAnalytics: true,
},
{
Path: "/compile",
PostBody: "body=" + url.QueryEscape("//empty"),
Substring: "expected 'package', found 'EOF'",
NoAnalytics: true,
},
{
Path: "/compile",
PostBody: "version=2&body=package+main%3Bimport+(%22fmt%22%3B%22time%22)%3Bfunc+main()%7Bfmt.Print(%22A%22)%3Btime.Sleep(time.Second)%3Bfmt.Print(%22B%22)%7D",
Regexp: `^{"Errors":"","Events":\[{"Message":"A","Kind":"stdout","Delay":0},{"Message":"B","Kind":"stdout","Delay":1000000000}\]}$`,
NoAnalytics: true,
},
{
Path: "/share",
PostBody: "package main",
Substring: "", // just check it is a 2xx.
NoAnalytics: true,
},
{
Path: "/x/net",
Substring: `<meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">`,
NoAnalytics: true,
},
{
Message: "release history page has an entry for Go 1.14.2",
Path: "/doc/devel/release",
Regexp: `go1\.14\.2\s+\(released 2020-04-08\)\s+includes\s+fixes to cgo, the go command, the runtime,`,
},
{
Message: "Go project page has an entry for Go 1.14",
Path: "/project",
Substring: `<li><a href="/doc/go1.14">Go 1.14</a> <small>(February 2020)</small></li>`,
},
{
Message: "Go project subpath does not exist",
Path: "/project/notexist",
StatusCode: http.StatusNotFound,
},
}
for _, tc := range substringTests {
t.Run(tc.Path, func(t *testing.T) {
method := "GET"
var reqBody io.Reader
if tc.PostBody != "" {
method = "POST"
reqBody = strings.NewReader(tc.PostBody)
}
req, err := http.NewRequest(method, *host+tc.Path, reqBody)
if err != nil {
t.Fatalf("NewRequest: %v", err)
}
if reqBody != nil {
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
}
resp, err := http.DefaultTransport.RoundTrip(req)
if err != nil {
t.Fatalf("RoundTrip: %v", err)
}
if tc.StatusCode == 0 {
if resp.StatusCode > 299 {
t.Errorf("Non-OK status code: %v", resp.StatusCode)
}
} else if tc.StatusCode != resp.StatusCode {
t.Errorf("StatusCode; got %v, want %v", resp.StatusCode, tc.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
t.Fatalf("ReadAll: %v", err)
}
const googleAnalyticsID = "UA-11222381-2" // golang.org analytics ID
if !tc.NoAnalytics && !bytes.Contains(body, []byte(googleAnalyticsID)) {
t.Errorf("want response to contain analytics tracking ID")
}
if tc.Substring != "" {
tc.Regexp = regexp.QuoteMeta(tc.Substring)
}
re := regexp.MustCompile(tc.Regexp)
if !re.Match(body) {
t.Log("------ actual output -------")
t.Log(string(body))
t.Log("----------------------------")
if tc.Message != "" {
t.Log(tc.Message)
}
t.Fatalf("wanted response to match %s", tc.Regexp)
}
})
}
webtest.TestServer(t, "testdata/live.txt", *host)
}

Просмотреть файл

@ -8,13 +8,11 @@
package main
import (
"net/http"
"net/http/httptest"
"strings"
"testing"
"golang.org/x/website"
"golang.org/x/website/internal/web"
"golang.org/x/website/internal/webtest"
)
// Test that the release history page includes expected entries.
@ -34,843 +32,5 @@ func TestReleaseHistory(t *testing.T) {
}
mux := registerHandlers(site)
req := httptest.NewRequest(http.MethodGet, "/doc/devel/release", nil)
rr := httptest.NewRecorder()
mux.ServeHTTP(rr, req)
resp := rr.Result()
if got, want := resp.StatusCode, http.StatusOK; got != want {
t.Errorf("got status code %d %s, want %d %s", got, http.StatusText(got), want, http.StatusText(want))
}
if got, want := resp.Header.Get("Content-Type"), "text/html; charset=utf-8"; got != want {
t.Errorf("got Content-Type header %q, want %q", got, want)
}
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")
}
if !strings.Contains(foldSpace(rr.Body.String()), foldSpace(wantOldReleaseHTML)) {
t.Errorf("got body that doesn't contain expected Go 1.12 and older release history entries")
}
webtest.TestHandler(t, "testdata/release.txt", mux)
}
// foldSpace returns s with each instance of one or more consecutive
// white space characters, as defined by unicode.IsSpace, replaced
// by a single space ('\x20') character, with leading and trailing
// white space removed.
func foldSpace(s string) string {
return strings.Join(strings.Fields(s), " ")
}
const wantGo114HTML = `
<h2 id="go1.14">go1.14 (released 2020-02-25)</h2>
<p>
Go 1.14 is a major release of Go.
Read the <a href="/doc/go1.14">Go 1.14 Release Notes</a> for more information.
</p>
<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
<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,
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.
</p>
`
const wantGo113HTML = `
<h2 id="go1.13">go1.13 (released 2019-09-03)</h2>
<p>
Go 1.13 is a major release of Go.
Read the <a href="/doc/go1.13">Go 1.13 Release Notes</a> for more information.
</p>
<h3 id="go1.13.minor">Minor revisions</h3>
<p>
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
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,
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
1.13.3 milestone</a> on our issue tracker for details.
</p>
<p>
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>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.4+label%3ACherryPickApproved">Go
1.13.4 milestone</a> on our issue tracker for details.
</p>
<p>
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
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
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
<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
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,
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.
</p>
`
const wantOldReleaseHTML = `
<h2 id="go1.12">go1.12 (released 2019-02-25)</h2>
<p>
Go 1.12 is a major release of Go.
Read the <a href="/doc/go1.12">Go 1.12 Release Notes</a> for more information.
</p>
<h3 id="go1.12.minor">Minor revisions</h3>
<p>
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
1.12.1 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.12.2 milestone</a> on our issue tracker for details.
</p>
<p>
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
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.
</p>
<p>
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,
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
1.12.6 milestone</a> on our issue tracker for details.
</p>
<p>
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
<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,
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
<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
<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,
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
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
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
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
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
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>
<p>
Go 1.11 is a major release of Go.
Read the <a href="/doc/go1.11">Go 1.11 Release Notes</a> for more information.
</p>
<h3 id="go1.11.minor">Minor revisions</h3>
<p>
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.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.1+label%3ACherryPickApproved">Go
1.11.1 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.11.2 milestone</a> on our issue tracker for details.
</p>
<p>
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,
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>
<code>get</code> for import path patterns containing "<code>...</code>".
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.4+label%3ACherryPickApproved">Go
1.11.4 milestone</a> on our issue tracker for details.
</p>
<p>
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,
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
1.11.6 milestone</a> on our issue tracker for details.
</p>
<p>
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
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
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.
</p>
<p>
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.
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.
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
<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>
<p>
Go 1.10 is a major release of Go.
Read the <a href="/doc/go1.10">Go 1.10 Release Notes</a> for more information.
</p>
<h3 id="go1.10.minor">Minor revisions</h3>
<p>
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.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.1+label%3ACherryPickApproved">Go
1.10.1 milestone</a> on our issue tracker for details.
</p>
<p>
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
<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>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.3+label%3ACherryPickApproved">Go
1.10.3 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.10.4 milestone</a> on our issue tracker for details.
</p>
<p>
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
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
1.10.6 milestone</a> on our issue tracker for details.
</p>
<p>
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">
Go 1.10.7 milestone</a> on our issue tracker for details.
</p>
<p>
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>
<p>
Go 1.9 is a major release of Go.
Read the <a href="/doc/go1.9">Go 1.9 Release Notes</a> for more information.
</p>
<h3 id="go1.9.minor">Minor revisions</h3>
<p>
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,
documentation, <code>go</code> command,
and the <code>crypto/x509</code>, <code>database/sql</code>, <code>log</code>,
and <code>net/smtp</code> packages.
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.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.2+label%3ACherryPickApproved">Go
1.9.2 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.9.3 milestone</a> on our issue tracker for details.
</p>
<p>
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
<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.
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
<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>.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.7+label%3ACherryPickApproved">Go
1.9.7 milestone</a> on our issue tracker for details.
</p>
<h2 id="go1.8">go1.8 (released 2017-02-16)</h2>
<p>
Go 1.8 is a major release of Go.
Read the <a href="/doc/go1.8">Go 1.8 Release Notes</a> for more information.
</p>
<h3 id="go1.8.minor">Minor revisions</h3>
<p>
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>,
and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.1">Go
1.8.1 milestone</a> on our issue tracker for details.
</p>
<p>
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,
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.
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,
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>
of non-Git repositories under certain conditions.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.5">Go
1.8.5 milestone</a> on our issue tracker for details.
</p>
<p>
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".
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>
<p>
Go 1.7 is a major release of Go.
Read the <a href="/doc/go1.7">Go 1.7 Release Notes</a> for more information.
</p>
<h3 id="go1.7.minor">Minor revisions</h3>
<p>
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>
packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.1">Go
1.7.1 milestone</a> on our issue tracker for details.
</p>
<p>
go1.7.2 should not be used. It was tagged but not fully released.
The release was deferred due to a last minute bug report.
Use go1.7.3 instead, and refer to the summary of changes below.
</p>
<p>
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
1.7.3 milestone</a> on our issue tracker for details.
</p>
<p>
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,
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
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>
<p>
Go 1.6 is a major release of Go.
Read the <a href="/doc/go1.6">Go 1.6 Release Notes</a> for more information.
</p>
<h3 id="go1.6.minor">Minor revisions</h3>
<p>
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,
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
1.6.2 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.6.3 milestone</a> on our issue tracker for details.
</p>
<p>
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>
<p>
Go 1.5 is a major release of Go.
Read the <a href="/doc/go1.5">Go 1.5 Release Notes</a> for more information.
</p>
<h3 id="go1.5.minor">Minor revisions</h3>
<p>
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
1.5.1 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.5.2 milestone</a> on our issue tracker for details.
</p>
<p>
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.
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>
<p>
Go 1.4 is a major release of Go.
Read the <a href="/doc/go1.4">Go 1.4 Release Notes</a> for more information.
</p>
<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.
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.
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.
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>
<p>
Go 1.3 is a major release of Go.
Read the <a href="/doc/go1.3">Go 1.3 Release Notes</a> for more information.
</p>
<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.
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.
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.
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>
<p>
Go 1.2 is a major release of Go.
Read the <a href="/doc/go1.2">Go 1.2 Release Notes</a> for more information.
</p>
<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.
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
<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>
<p>
Go 1.1 is a major release of Go.
Read the <a href="/doc/go1.1">Go 1.1 Release Notes</a> for more information.
</p>
<h3 id="go1.1.minor">Minor revisions</h3>
<p>
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
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.
If you use package syscall's <code>Getrlimit</code> and <code>Setrlimit</code>
functions under Linux on the ARM or 386 architectures, please note change
<a href="//golang.org/cl/11803043">11803043</a>
that fixes <a href="//golang.org/issue/5949">issue 5949</a>.
</p>
<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.
Read the <a href="/doc/go1.html">Go 1 Release Notes</a> for more information.
</p>
<p>
It is intended that programs written for Go 1 will continue to compile and run
correctly, unchanged, under future versions of Go 1.
Read the <a href="/doc/go1compat.html">Go 1 compatibility document</a> for more
about the future of Go 1.
</p>
<p>
The go1 release corresponds to
<code><a href="weekly.html#2012-03-27">weekly.2012-03-27</a></code>.
</p>
<h3 id="go1.minor">Minor revisions</h3>
<p>
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.
It also includes several minor code and documentation fixes.
</p>
<p>
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>.
It also includes many minor code and documentation fixes.
</p>
<p>
go1.0.3 (released 2012-09-21) includes minor code and documentation fixes.
</p>
<p>
See the <a href="https://github.com/golang/go/commits/release-branch.go1">go1 release branch history</a> for the complete list of changes.
</p>
`

81
cmd/golangorg/testdata/live.txt поставляемый Normal file
Просмотреть файл

@ -0,0 +1,81 @@
GET /doc/
body contains an introduction to using modules in a simple project
GET /conduct
body contains Project Stewards
GET /doc/devel/release
body ~ go1\.14\.2\s+\(released 2020-04-08\)\s+includes\s+fixes to cgo, the go command, the runtime,
GET /doc/devel/release.html
redirect == /doc/devel/release
GET /doc/faq
body contains What is the purpose of the project
GET /pkg/
body contains Package tar
GET /pkg/os/
body contains func Open
GET /pkg/net/http/
body contains title="Added in Go 1.11"
GET /robots.txt
body contains Disallow: /search
body !contains UA-
GET /change/75944e2e3a63
code == 302
redirect contains bdb10cf
body contains bdb10cf
body !contains UA-
GET /dl/
body contains href="/dl/go1.11.windows-amd64.msi"
GET /dl/?mode=json
body contains .windows-amd64.msi
body !contains UA-
GET /s/go2design
code == 302
body ~ proposal.*Found
body !contains UA-
POST /compile
postquery
body=package main; func main() { print(6*7); }
body == {"compile_errors":"","output":"42"}
POST /compile
postquery
body=//empty
body contains expected 'package', found 'EOF'
body !contains UA-
POST /compile
postquery
version=2
body=package main; import ("fmt"; "time"); func main() {fmt.Print("A"); time.Sleep(time.Second); fmt.Print("B")}
body == {"Errors":"","Events":[{"Message":"A","Kind":"stdout","Delay":0},{"Message":"B","Kind":"stdout","Delay":1000000000}]}
POST /share
postbody
package main
body !contains UA-
GET /x/net
code == 200
body contains <meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">
body !contains UA-
GET /project
body contains <li><a href="/doc/go1.14">Go 1.14</a> <small>(February 2020)</small></li>
GET /project/
redirect == /project
GET /project/notexist
code == 404

854
cmd/golangorg/testdata/release.txt поставляемый Normal file
Просмотреть файл

@ -0,0 +1,854 @@
GET /doc/devel/release
header content-type == text/html; charset=utf-8
trimbody contains
<h2 id="go1.14">go1.14 (released 2020-02-25)</h2>
<p>
Go 1.14 is a major release of Go.
Read the <a href="/doc/go1.14">Go 1.14 Release Notes</a> for more information.
</p>
<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
<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, 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.
</p>
trimbody contains
<h2 id="go1.13">go1.13 (released 2019-09-03)</h2>
<p>
Go 1.13 is a major release of Go.
Read the <a href="/doc/go1.13">Go 1.13 Release Notes</a> for more information.
</p>
<h3 id="go1.13.minor">Minor revisions</h3>
<p>
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 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, 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 1.13.3 milestone</a>
on our issue tracker for details.
</p>
<p>
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>.
See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.13.4+label%3ACherryPickApproved">Go 1.13.4 milestone</a>
on our issue tracker for details.
</p>
<p>
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 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 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 <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 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, 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.
</p>
<p>
trimbody contains
<h2 id="go1.12">go1.12 (released 2019-02-25)</h2>
<p>
Go 1.12 is a major release of Go.
Read the <a href="/doc/go1.12">Go 1.12 Release Notes</a> for more information.
</p>
<h3 id="go1.12.minor">Minor revisions</h3>
<p>
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 1.12.1 milestone</a>
on our issue tracker for details.
</p>
<p>
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 1.12.2 milestone</a>
on our issue tracker for details.
</p>
<p>
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
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.
</p>
<p>
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, 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 1.12.6 milestone</a>
on our issue tracker for details.
</p>
<p>
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 <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, 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 <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 <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, 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
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 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 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 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 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>
<p>
Go 1.11 is a major release of Go.
Read the <a href="/doc/go1.11">Go 1.11 Release Notes</a> for more information.
</p>
<h3 id="go1.11.minor">Minor revisions</h3>
<p>
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.
See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.1+label%3ACherryPickApproved">Go 1.11.1 milestone</a>
on our issue tracker for details.
</p>
<p>
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 1.11.2 milestone</a>
on our issue tracker for details.
</p>
<p>
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, 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>
<code>get</code> for import path patterns containing "<code>...</code>".
See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.4+label%3ACherryPickApproved">Go 1.11.4 milestone</a>
on our issue tracker for details.
</p>
<p>
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, 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 1.11.6 milestone</a>
on our issue tracker for details.
</p>
<p>
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
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
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.
</p>
<p>
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.
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.
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 <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>
<p>
Go 1.10 is a major release of Go.
Read the <a href="/doc/go1.10">Go 1.10 Release Notes</a> for more information.
</p>
<h3 id="go1.10.minor">Minor revisions</h3>
<p>
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.
See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.1+label%3ACherryPickApproved">Go 1.10.1 milestone</a>
on our issue tracker for details.
</p>
<p>
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 <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>.
See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.3+label%3ACherryPickApproved">Go 1.10.3 milestone</a>
on our issue tracker for details.
</p>
<p>
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 1.10.4 milestone</a>
on our issue tracker for details.
</p>
<p>
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 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 1.10.6 milestone</a>
on our issue tracker for details.
</p>
<p>
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">
Go 1.10.7 milestone</a> on our issue tracker for details.
</p>
<p>
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>
<p>
Go 1.9 is a major release of Go.
Read the <a href="/doc/go1.9">Go 1.9 Release Notes</a> for more information.
</p>
<h3 id="go1.9.minor">Minor revisions</h3>
<p>
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, documentation, <code>go</code> command, and the <code>crypto/x509</code>, <code>database/sql</code>, <code>log</code>, and <code>net/smtp</code> packages.
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.
See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.2+label%3ACherryPickApproved">Go 1.9.2 milestone</a>
on our issue tracker for details.
</p>
<p>
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 1.9.3 milestone</a>
on our issue tracker for details.
</p>
<p>
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 <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.
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 <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>.
See the
<a href="https://github.com/golang/go/issues?q=milestone%3AGo1.9.7+label%3ACherryPickApproved">Go 1.9.7 milestone</a>
on our issue tracker for details.
</p>
<h2 id="go1.8">go1.8 (released 2017-02-16)</h2>
<p>
Go 1.8 is a major release of Go.
Read the <a href="/doc/go1.8">Go 1.8 Release Notes</a> for more information.
</p>
<h3 id="go1.8.minor">Minor revisions</h3>
<p>
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>,
and <code>time</code> packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.1">Go
1.8.1 milestone</a> on our issue tracker for details.
</p>
<p>
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,
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.
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,
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>
of non-Git repositories under certain conditions.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.8.5">Go
1.8.5 milestone</a> on our issue tracker for details.
</p>
<p>
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".
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>
<p>
Go 1.7 is a major release of Go.
Read the <a href="/doc/go1.7">Go 1.7 Release Notes</a> for more information.
</p>
<h3 id="go1.7.minor">Minor revisions</h3>
<p>
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>
packages.
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.7.1">Go
1.7.1 milestone</a> on our issue tracker for details.
</p>
<p>
go1.7.2 should not be used. It was tagged but not fully released.
The release was deferred due to a last minute bug report.
Use go1.7.3 instead, and refer to the summary of changes below.
</p>
<p>
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
1.7.3 milestone</a> on our issue tracker for details.
</p>
<p>
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,
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
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>
<p>
Go 1.6 is a major release of Go.
Read the <a href="/doc/go1.6">Go 1.6 Release Notes</a> for more information.
</p>
<h3 id="go1.6.minor">Minor revisions</h3>
<p>
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,
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
1.6.2 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.6.3 milestone</a> on our issue tracker for details.
</p>
<p>
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>
<p>
Go 1.5 is a major release of Go.
Read the <a href="/doc/go1.5">Go 1.5 Release Notes</a> for more information.
</p>
<h3 id="go1.5.minor">Minor revisions</h3>
<p>
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
1.5.1 milestone</a> on our issue tracker for details.
</p>
<p>
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
1.5.2 milestone</a> on our issue tracker for details.
</p>
<p>
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.
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>
<p>
Go 1.4 is a major release of Go.
Read the <a href="/doc/go1.4">Go 1.4 Release Notes</a> for more information.
</p>
<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.
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.
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.
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>
<p>
Go 1.3 is a major release of Go.
Read the <a href="/doc/go1.3">Go 1.3 Release Notes</a> for more information.
</p>
<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.
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.
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.
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>
<p>
Go 1.2 is a major release of Go.
Read the <a href="/doc/go1.2">Go 1.2 Release Notes</a> for more information.
</p>
<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.
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
<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>
<p>
Go 1.1 is a major release of Go.
Read the <a href="/doc/go1.1">Go 1.1 Release Notes</a> for more information.
</p>
<h3 id="go1.1.minor">Minor revisions</h3>
<p>
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
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.
If you use package syscall's <code>Getrlimit</code> and <code>Setrlimit</code>
functions under Linux on the ARM or 386 architectures, please note change
<a href="//golang.org/cl/11803043">11803043</a>
that fixes <a href="//golang.org/issue/5949">issue 5949</a>.
</p>
<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.
Read the <a href="/doc/go1.html">Go 1 Release Notes</a> for more information.
</p>
<p>
It is intended that programs written for Go 1 will continue to compile and run
correctly, unchanged, under future versions of Go 1.
Read the <a href="/doc/go1compat.html">Go 1 compatibility document</a> for more
about the future of Go 1.
</p>
<p>
The go1 release corresponds to
<code><a href="weekly.html#2012-03-27">weekly.2012-03-27</a></code>.
</p>
<h3 id="go1.minor">Minor revisions</h3>
<p>
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.
It also includes several minor code and documentation fixes.
</p>
<p>
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>.
It also includes many minor code and documentation fixes.
</p>
<p>
go1.0.3 (released 2012-09-21) includes minor code and documentation fixes.
</p>
<p>
See the <a href="https://github.com/golang/go/commits/release-branch.go1">go1 release branch history</a> for the complete list of changes.
</p>

99
cmd/golangorg/testdata/web.txt поставляемый Normal file
Просмотреть файл

@ -0,0 +1,99 @@
GET /
body contains Go is an open source programming language
body contains Binary distributions available for
GET /conduct
body contains Project Stewards
GET /doc/asm
body ~ Quick Guide.*Assembler
GET /doc/gdb
body contains Debugging Go Code
GET /doc/debugging_with_gdb.html
redirect == /doc/gdb
GET /ref/spec
body contains Go Programming Language Specification
GET /doc/go_spec
redirect == /ref/spec
GET /doc/go_spec.html
redirect == /ref/spec
GET /doc/go_spec.md
redirect == /ref/spec
GET /ref/mem
body contains Memory Model
GET /doc/go_mem.html
redirect == /ref/mem
GET /doc/go_mem.md
redirect == /ref/mem
GET /doc/help.html
redirect == /help
GET /help/
redirect == /help
GET /help
body contains Get help
GET /pkg/fmt/
body contains Package fmt implements formatted I/O
GET /src/fmt/
body contains scan_test.go
GET /src/fmt/print.go
body contains // Println formats using
GET /pkg
redirect == /pkg/
GET /pkg/
body contains Standard library
body contains Package fmt implements formatted I/O
body !contains internal/syscall
body !contains cmd/gc
GET /pkg/?m=all
body contains Standard library
body contains Package fmt implements formatted I/O
body contains internal/syscall/?m=all
body !contains cmd/gc
GET /pkg/strings/
body contains href="/src/strings/strings.go"
GET /cmd/compile/internal/amd64/
body contains href="/src/cmd/compile/internal/amd64/ssa.go"
GET /pkg/math/bits/
body contains Added in Go 1.9
GET /pkg/net/
body contains // IPv6 scoped addressing zone; added in Go 1.1
GET /pkg/net/http/httptrace/
body ~ Got1xxResponse.*// Go 1\.11
body ~ GotFirstResponseByte func\(\)\s*$
GET /pkg/database/sql/
body contains The number of connections currently in use; added in Go 1.11
body contains The number of idle connections; added in Go 1.11
GET /project
body contains <li><a href="/doc/go1.14">Go 1.14</a> <small>(February 2020)</small></li>
body contains <li><a href="/doc/go1.1">Go 1.1</a> <small>(May 2013)</small></li>
GET /doc/go1.16.html
redirect == /doc/go1.16
GET /doc/go1.16
body contains Go 1.16

25
cmd/golangorg/testdata/x.txt поставляемый Normal file
Просмотреть файл

@ -0,0 +1,25 @@
GET /x/net
code == 200
body contains <meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">
body contains http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/net">
GET /x/net/suffix
code == 200
body contains <meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">
body contains http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/net/suffix">
GET /x/pkgsite
code == 200
body contains <meta name="go-import" content="golang.org/x/pkgsite git https://go.googlesource.com/pkgsite">
body contains <a href="https://pkg.go.dev/golang.org/x/pkgsite">Redirecting to documentation...</a>
body contains http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/pkgsite">
GET /x/notexist
code == 404
GET /x/
code == 307
header location == https://pkg.go.dev/search?q=golang.org/x
GET /x/In%20Valid,X
code == 404

Просмотреть файл

@ -8,98 +8,12 @@
package main
import (
"net/http/httptest"
"strings"
"net/http"
"testing"
"golang.org/x/website/internal/webtest"
)
func TestXHandler(t *testing.T) {
type check func(t *testing.T, rec *httptest.ResponseRecorder)
status := func(v int) check {
return func(t *testing.T, rec *httptest.ResponseRecorder) {
t.Helper()
if rec.Code != v {
t.Errorf("response status = %v; want %v", rec.Code, v)
}
}
}
substr := func(s string) check {
return func(t *testing.T, rec *httptest.ResponseRecorder) {
t.Helper()
if !strings.Contains(rec.Body.String(), s) {
t.Errorf("missing expected substring %q in value: %#q", s, rec.Body)
}
}
}
hasHeader := func(k, v string) check {
return func(t *testing.T, rec *httptest.ResponseRecorder) {
t.Helper()
if got := rec.HeaderMap.Get(k); got != v {
t.Errorf("header[%q] = %q; want %q", k, got, v)
}
}
}
tests := []struct {
name string
path string
checks []check
}{
{
name: "net",
path: "/x/net",
checks: []check{
status(200),
substr(`<meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">`),
substr(`http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/net">`),
},
},
{
name: "net-suffix",
path: "/x/net/suffix",
checks: []check{
status(200),
substr(`<meta name="go-import" content="golang.org/x/net git https://go.googlesource.com/net">`),
substr(`http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/net/suffix">`),
},
},
{
name: "pkgsite",
path: "/x/pkgsite",
checks: []check{
status(200),
substr(`<meta name="go-import" content="golang.org/x/pkgsite git https://go.googlesource.com/pkgsite">`),
substr(`<a href="https://pkg.go.dev/golang.org/x/pkgsite">Redirecting to documentation...</a>`),
substr(`http-equiv="refresh" content="0; url=https://pkg.go.dev/golang.org/x/pkgsite">`),
},
},
{
name: "notexist",
path: "/x/notexist",
checks: []check{status(404)},
},
{
name: "empty",
path: "/x/",
checks: []check{
status(307),
hasHeader("Location", "https://pkg.go.dev/search?q=golang.org/x"),
},
},
{
name: "invalid",
path: "/x/In%20Valid,X",
checks: []check{status(404)},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
req := httptest.NewRequest("GET", tt.path, nil)
rec := httptest.NewRecorder()
xHandler(rec, req)
for _, check := range tt.checks {
check(t, rec)
}
})
}
webtest.TestHandler(t, "testdata/x.txt", http.HandlerFunc(xHandler))
}