Skip to content

Commit

Permalink
Merge "[dev.typeparams] all: merge dev.regabi (7e0a81d) into dev.type…
Browse files Browse the repository at this point in the history
…params" into dev.typeparams
  • Loading branch information
Gerrit Code Review committed Jan 23, 2021
2 parents 6923019 + 6e46c8f commit 1946a77
Show file tree
Hide file tree
Showing 352 changed files with 9,499 additions and 7,197 deletions.
15 changes: 3 additions & 12 deletions api/go1.16.txt
@@ -1,15 +1,6 @@
pkg archive/zip, method (*ReadCloser) Open(string) (fs.File, error)
pkg archive/zip, method (*Reader) Open(string) (fs.File, error)
pkg crypto/x509, method (SystemRootsError) Unwrap() error
pkg crypto/x509, type CertificateRequest struct, BasicConstraintsValid bool
pkg crypto/x509, type CertificateRequest struct, ExtKeyUsage []ExtKeyUsage
pkg crypto/x509, type CertificateRequest struct, IsCA bool
pkg crypto/x509, type CertificateRequest struct, KeyUsage KeyUsage
pkg crypto/x509, type CertificateRequest struct, MaxPathLen int
pkg crypto/x509, type CertificateRequest struct, MaxPathLenZero bool
pkg crypto/x509, type CertificateRequest struct, PolicyIdentifiers []asn1.ObjectIdentifier
pkg crypto/x509, type CertificateRequest struct, SubjectKeyId []uint8
pkg crypto/x509, type CertificateRequest struct, UnknownExtKeyUsage []asn1.ObjectIdentifier
pkg debug/elf, const DT_ADDRRNGHI = 1879047935
pkg debug/elf, const DT_ADDRRNGHI DynTag
pkg debug/elf, const DT_ADDRRNGLO = 1879047680
Expand Down Expand Up @@ -235,9 +226,12 @@ pkg embed, type FS struct
pkg flag, func Func(string, string, func(string) error)
pkg flag, method (*FlagSet) Func(string, string, func(string) error)
pkg go/build, type Package struct, EmbedPatterns []string
pkg go/build, type Package struct, EmbedPatternPos map[string][]token.Position
pkg go/build, type Package struct, IgnoredOtherFiles []string
pkg go/build, type Package struct, TestEmbedPatterns []string
pkg go/build, type Package struct, TestEmbedPatternPos map[string][]token.Position
pkg go/build, type Package struct, XTestEmbedPatterns []string
pkg go/build, type Package struct, XTestEmbedPatternPos map[string][]token.Position
pkg html/template, func ParseFS(fs.FS, ...string) (*Template, error)
pkg html/template, method (*Template) ParseFS(fs.FS, ...string) (*Template, error)
pkg io, func NopCloser(Reader) ReadCloser
Expand Down Expand Up @@ -404,7 +398,6 @@ pkg runtime/metrics, type Description struct, Cumulative bool
pkg runtime/metrics, type Description struct, Description string
pkg runtime/metrics, type Description struct, Kind ValueKind
pkg runtime/metrics, type Description struct, Name string
pkg runtime/metrics, type Description struct, StopTheWorld bool
pkg runtime/metrics, type Float64Histogram struct
pkg runtime/metrics, type Float64Histogram struct, Buckets []float64
pkg runtime/metrics, type Float64Histogram struct, Counts []uint64
Expand Down Expand Up @@ -437,10 +430,8 @@ pkg syscall (linux-arm-cgo), func AllThreadsSyscall(uintptr, uintptr, uintptr, u
pkg syscall (linux-arm-cgo), func AllThreadsSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
pkg syscall (linux-arm-cgo), func Setegid(int) error
pkg syscall (linux-arm-cgo), func Seteuid(int) error
pkg syscall (windows-386), func RtlGenRandom(*uint8, uint32) error
pkg syscall (windows-386), method (*DLLError) Unwrap() error
pkg syscall (windows-386), type SysProcAttr struct, NoInheritHandles bool
pkg syscall (windows-amd64), func RtlGenRandom(*uint8, uint32) error
pkg syscall (windows-amd64), method (*DLLError) Unwrap() error
pkg syscall (windows-amd64), type SysProcAttr struct, NoInheritHandles bool
pkg testing/fstest, func TestFS(fs.FS, ...string) error
Expand Down
4 changes: 2 additions & 2 deletions doc/contribute.html
Expand Up @@ -1023,13 +1023,13 @@ <h3 id="copyright">Copyright headers</h3>
</p>

<pre>
// Copyright 2020 The Go Authors. All rights reserved.
// 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.
</pre>

<p>
(Use the current year if you're reading this in 2021 or beyond.)
(Use the current year if you're reading this in 2022 or beyond.)
Files in the repository are copyrighted the year they are added.
Do not update the copyright year on files that you change.
</p>
Expand Down
4 changes: 1 addition & 3 deletions doc/editors.html
Expand Up @@ -19,13 +19,11 @@ <h2 id="options">Options</h2>
</p>

<ul>
<li><a href="https://github.com/fatih/vim-go">vim</a>: vim-go plugin provides Go programming language support</li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=golang.go">Visual Studio Code</a>:
Go extension provides support for the Go programming language</li>
<li><a href="https://www.jetbrains.com/go">GoLand</a>: GoLand is distributed either as a standalone IDE
or as a plugin for IntelliJ IDEA Ultimate</li>
<li><a href="https://atom.io/packages/go-plus">Atom</a>: Go-Plus is an Atom package that provides enhanced Go support</li>
</ul>
<li><a href="https://github.com/fatih/vim-go">vim</a>: vim-go plugin provides Go programming language support</li>

<p>
Note that these are only a few top solutions; a more comprehensive
Expand Down
117 changes: 95 additions & 22 deletions doc/go1.16.html
Expand Up @@ -55,7 +55,9 @@ <h3 id="darwin">Darwin and iOS</h3>
Go 1.16 adds an <code>ios/amd64</code> port, which targets the iOS
simulator running on AMD64-based macOS. Previously this was
unofficially supported through <code>darwin/amd64</code> with
the <code>ios</code> build tag set.
the <code>ios</code> build tag set. See also
<a href="/misc/ios/README"><code>misc/ios/README</code></a> for
details about how to build programs for iOS and iOS simulator.
</p>

<p><!-- golang.org/issue/23011 -->
Expand Down Expand Up @@ -162,6 +164,12 @@ <h4 id="modules">Modules</h4>
non-reproducible builds.
</p>

<p><!-- golang.org/issue/43052 -->
The <code>go</code> command now disallows non-ASCII import paths in module
mode. Non-ASCII module paths have already been disallowed so this change
affects module subdirectory paths that contain non-ASCII characters.
</p>

<h4 id="embed">Embedding Files</h4>

<p>
Expand Down Expand Up @@ -504,6 +512,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
in mind.
</p>

<dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
<dd>
<p><!-- CL 243937 -->
The new <a href="/pkg/archive/zip/#Reader.Open"><code>Reader.Open</code></a>
method implements the <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>
interface.
</p>
</dd>
</dl>

<dl id="crypto/dsa"><dt><a href="/pkg/crypto/dsa/">crypto/dsa</a></dt>
<dd>
<p><!-- CL 257939 -->
Expand Down Expand Up @@ -588,14 +606,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
a malformed certificate.
</p>

<p><!-- CL 233163 -->
A number of additional fields have been added to the
<a href="/pkg/crypto/x509/#CertificateRequest"><code>CertificateRequest</code></a> type.
These fields are now parsed in <a href="/pkg/crypto/x509/#ParseCertificateRequest">
<code>ParseCertificateRequest</code></a> and marshalled in
<a href="/pkg/crypto/x509/#CreateCertificateRequest"><code>CreateCertificateRequest</code></a>.
</p>

<p><!-- CL 257939 -->
DSA signature verification is no longer supported. Note that DSA signature
generation was never supported.
Expand All @@ -616,6 +626,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</dd>
</dl><!-- crypto/x509 -->

<dl id="debug/elf"><dt><a href="/pkg/debug/elf/">debug/elf</a></dt>
<dd>
<p><!-- CL 255138 -->
More <a href="/pkg/debug/elf/#DT_NULL"><code>DT</code></a>
and <a href="/pkg/debug/elf/#PT_NULL"><code>PT</code></a>
constants have been added.
</p>
</dd>
</dl><!-- debug/elf -->

<dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1">encoding/asn1</a></dt>
<dd>
<p><!-- CL 255881 -->
Expand Down Expand Up @@ -665,6 +685,18 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</dd>
</dl><!-- flag -->

<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
<dd>
<p><!-- CL 243938 -->
The new <a href="/pkg/html/template/#ParseFS"><code>template.ParseFS</code></a>
function and <a href="/pkg/html/template/#Template.ParseFS"><code>template.Template.ParseFS</code></a>
method are like <a href="/pkg/html/template/#ParseGlob"><code>template.ParseGlob</code></a>
and <a href="/pkg/html/template/#Template.ParseGlob"><code>template.Template.ParseGlob</code></a>,
but read the templates from an <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>.
</p>
</dd>
</dl><!-- html/template -->

<dl id="io"><dt><a href="/pkg/io/">io</a></dt>
<dd>
<p><!-- CL 261577 -->
Expand Down Expand Up @@ -774,6 +806,25 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
environment variable for <code>https://</code> URLs when
<code>HTTPS_PROXY</code> is unset.
</p>

<p><!-- 259917 -->
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
type has a new field
<a href="/pkg/net/http/#Transport.GetProxyConnectHeader"><code>GetProxyConnectHeader</code></a>
which may be set to a function that returns headers to send to a
proxy during a <code>CONNECT</code> request.
In effect <code>GetProxyConnectHeader</code> is a dynamic
version of the existing field
<a href="/pkg/net/http/#Transport.ProxyConnectHeader"><code>ProxyConnectHeader</code></a>;
if <code>GetProxyConnectHeader</code> is not <code>nil</code>,
then <code>ProxyConnectHeader</code> is ignored.
</p>

<p><!-- CL 243939 -->
The new <a href="/pkg/net/http/#FS"><code>http.FS</code></a>
function converts an <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>
to an <a href="/pkg/net/http/#Handler"><code>http.Handler</code></a>.
</p>
</dd>
</dl><!-- net/http -->

Expand Down Expand Up @@ -834,6 +885,21 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>

<dl id="path/filepath"><dt><a href="/pkg/path/filepath/">path/filepath</a></dt>
<dd>
<p><!-- CL 267887 -->
The new function
<a href="/pkg/path/filepath/WalkDir"><code>WalkDir</code></a>
is similar to
<a href="/pkg/path/filepath/Walk"><code>Walk</code></a>,
but is typically more efficient.
The function passed to <code>WalkDir</code> receives a
<a href="/pkg/io/fs/#DirEntry"><code>fs.DirEntry</code></a>
instead of a
<a href="/pkg/io/fs/#FileInfo"><code>fs.FileInfo</code></a>.
(To clarify for those who recall the <code>Walk</code> function
as taking an <a href="/pkg/os/#FileInfo"><code>os.FileInfo</code></a>,
<code>os.FileInfo</code> is now an alias for <code>fs.FileInfo</code>.)
</p>

<p><!-- CL 264397, golang.org/issues/28614 -->
The <a href="/pkg/path/filepath#Match"><code>Match</code></a> and
<a href="/pkg/path/filepath#Glob"><code>Glob</code></a> functions now
Expand All @@ -845,17 +911,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</dd>
</dl><!-- path/filepath -->

<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
<dd>
<p><!-- CL 248341, golang.org/issues/40281 -->
<a href="/pkg/reflect/#StructTag"><code>StructTag</code></a>
now allows multiple space-separated keys in key:value pairs,
as in <code>`json xml:"field1"`</code> (equivalent to
<code>`json:"field1" xml:"field1"`</code>).
</p>
</dd>
</dl><!-- reflect -->

<dl id="runtime/debug"><dt><a href="/pkg/runtime/debug/">runtime/debug</a></dt>
<dd>
<p><!-- CL 249677 -->
Expand Down Expand Up @@ -893,11 +948,11 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</p>

<p><!-- CL 261917 -->
<a href="/pkg/syscall/?GOOS=windows#SysProcAttr"><code>SysProcAttr</code></a> on Windows has a new NoInheritHandles field that disables inheriting handles when creating a new process.
<a href="/pkg/syscall/?GOOS=windows#SysProcAttr"><code>SysProcAttr</code></a> on Windows has a new <code>NoInheritHandles</code> field that disables inheriting handles when creating a new process.
</p>

<p><!-- CL 269761, golang.org/issue/42584 -->
<a href="/pkg/syscall/?GOOS=windows#DLLError"><code>DLLError</code></a> on Windows now has an Unwrap function for unwrapping its underlying error.
<a href="/pkg/syscall/?GOOS=windows#DLLError"><code>DLLError</code></a> on Windows now has an <code>Unwrap</code> method for unwrapping its underlying error.
</p>

<p><!-- CL 210639 -->
Expand All @@ -907,6 +962,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
and related calls are now implemented.
Previously, they returned an <code>syscall.EOPNOTSUPP</code> error.
</p>

<p><!-- CL 210639 -->
On Linux, the new functions
<a href="/pkg/syscall/#AllThreadsSyscall"><code>AllThreadsSyscall</code></a>
and <a href="/pkg/syscall/#AllThreadsSyscall6"><code>AllThreadsSyscall6</code></a>
may be used to make a system call on all Go threads in the process.
These functions may only be used by programs that do not use cgo;
if a program uses cgo, they will always return
<a href="/pkg/syscall/#ENOTSUP"><code>syscall.ENOTSUP</code></a>.
</p>
</dd>
</dl><!-- syscall -->

Expand All @@ -916,6 +981,14 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
Newlines characters are now allowed inside action delimiters,
permitting actions to span multiple lines.
</p>

<p><!-- CL 243938 -->
The new <a href="/pkg/text/template/#ParseFS"><code>template.ParseFS</code></a>
function and <a href="/pkg/text/template/#Template.ParseFS"><code>template.Template.ParseFS</code></a>
method are like <a href="/pkg/text/template/#ParseGlob"><code>template.ParseGlob</code></a>
and <a href="/pkg/text/template/#Template.ParseGlob"><code>template.Template.ParseGlob</code></a>,
but read the templates from an <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>.
</p>
</dd>
</dl><!-- text/template -->

Expand Down
4 changes: 2 additions & 2 deletions lib/time/update.bash
Expand Up @@ -8,8 +8,8 @@
# Consult https://www.iana.org/time-zones for the latest versions.

# Versions to use.
CODE=2020e
DATA=2020e
CODE=2020f
DATA=2020f

set -e
rm -rf work
Expand Down
Binary file modified lib/time/zoneinfo.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion misc/cgo/test/pkg_test.go
Expand Up @@ -30,7 +30,7 @@ func TestCrossPackageTests(t *testing.T) {
switch runtime.GOOS {
case "android":
t.Skip("Can't exec cmd/go subprocess on Android.")
case "darwin", "ios":
case "ios":
switch runtime.GOARCH {
case "arm64":
t.Skip("Can't exec cmd/go subprocess on iOS.")
Expand Down
5 changes: 0 additions & 5 deletions misc/cgo/testcarchive/carchive_test.go
Expand Up @@ -118,11 +118,6 @@ func testMain(m *testing.M) int {
cc = append(cc, s[start:])
}

if GOOS == "darwin" || GOOS == "ios" {
// For Darwin/ARM.
// TODO: do we still need this?
cc = append(cc, []string{"-framework", "CoreFoundation", "-framework", "Foundation"}...)
}
if GOOS == "aix" {
// -Wl,-bnoobjreorder is mandatory to keep the same layout
// in .text section.
Expand Down
7 changes: 7 additions & 0 deletions misc/ios/README
Expand Up @@ -7,6 +7,13 @@ set to the clang wrapper that invokes clang for iOS. For example, this command r

GOOS=ios GOARCH=amd64 CGO_ENABLED=1 CC_FOR_TARGET=$(pwd)/../misc/ios/clangwrap.sh ./all.bash

If CC_FOR_TARGET is not set when the toolchain is built (make.bash or all.bash), CC
can be set on the command line. For example,

GOOS=ios GOARCH=amd64 CGO_ENABLED=1 CC=$(go env GOROOT)/misc/ios/clangwrap.sh go build

Setting CC is not necessary if the toolchain is built with CC_FOR_TARGET set.

To use the go tool to run individual programs and tests, put $GOROOT/bin into PATH to ensure
the go_ios_$GOARCH_exec wrapper is found. For example, to run the archive/tar tests:

Expand Down
2 changes: 1 addition & 1 deletion src/archive/tar/strconv.go
Expand Up @@ -28,7 +28,7 @@ func isASCII(s string) bool {
}

// toASCII converts the input to an ASCII C-style string.
// This a best effort conversion, so invalid characters are dropped.
// This is a best effort conversion, so invalid characters are dropped.
func toASCII(s string) string {
if isASCII(s) {
return s
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/api/goapi.go
Expand Up @@ -16,10 +16,10 @@ import (
"go/parser"
"go/token"
"go/types"
exec "internal/execabs"
"io"
"log"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/api/run.go
Expand Up @@ -10,9 +10,9 @@ package main

import (
"fmt"
exec "internal/execabs"
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/asm/internal/asm/parse.go
Expand Up @@ -305,7 +305,7 @@ func (p *Parser) pseudo(word string, operands [][]lex.Token) bool {
// references and writes symabis information to w.
//
// The symabis format is documented at
// cmd/compile/internal/gc.readSymABIs.
// cmd/compile/internal/ssagen.ReadSymABIs.
func (p *Parser) symDefRef(w io.Writer, word string, operands [][]lex.Token) {
switch word {
case "TEXT":
Expand Down
7 changes: 7 additions & 0 deletions src/cmd/cgo/gcc.go
Expand Up @@ -1549,7 +1549,14 @@ func (p *Package) gccBaseCmd() []string {
func (p *Package) gccMachine() []string {
switch goarch {
case "amd64":
if goos == "darwin" {
return []string{"-arch", "x86_64", "-m64"}
}
return []string{"-m64"}
case "arm64":
if goos == "darwin" {
return []string{"-arch", "arm64"}
}
case "386":
return []string{"-m32"}
case "arm":
Expand Down

0 comments on commit 1946a77

Please sign in to comment.