Skip to content

Commit decd7b7

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 41884-fix
2 parents 43b589f + cd99385 commit decd7b7

File tree

229 files changed

+5464
-3507
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+5464
-3507
lines changed

api/go1.16.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
pkg archive/zip, method (*ReadCloser) Open(string) (fs.File, error)
22
pkg archive/zip, method (*Reader) Open(string) (fs.File, error)
33
pkg crypto/x509, method (SystemRootsError) Unwrap() error
4-
pkg crypto/x509, type CertificateRequest struct, BasicConstraintsValid bool
5-
pkg crypto/x509, type CertificateRequest struct, ExtKeyUsage []ExtKeyUsage
6-
pkg crypto/x509, type CertificateRequest struct, IsCA bool
7-
pkg crypto/x509, type CertificateRequest struct, KeyUsage KeyUsage
8-
pkg crypto/x509, type CertificateRequest struct, MaxPathLen int
9-
pkg crypto/x509, type CertificateRequest struct, MaxPathLenZero bool
10-
pkg crypto/x509, type CertificateRequest struct, PolicyIdentifiers []asn1.ObjectIdentifier
11-
pkg crypto/x509, type CertificateRequest struct, SubjectKeyId []uint8
12-
pkg crypto/x509, type CertificateRequest struct, UnknownExtKeyUsage []asn1.ObjectIdentifier
134
pkg debug/elf, const DT_ADDRRNGHI = 1879047935
145
pkg debug/elf, const DT_ADDRRNGHI DynTag
156
pkg debug/elf, const DT_ADDRRNGLO = 1879047680
@@ -235,9 +226,12 @@ pkg embed, type FS struct
235226
pkg flag, func Func(string, string, func(string) error)
236227
pkg flag, method (*FlagSet) Func(string, string, func(string) error)
237228
pkg go/build, type Package struct, EmbedPatterns []string
229+
pkg go/build, type Package struct, EmbedPatternPos map[string][]token.Position
238230
pkg go/build, type Package struct, IgnoredOtherFiles []string
239231
pkg go/build, type Package struct, TestEmbedPatterns []string
232+
pkg go/build, type Package struct, TestEmbedPatternPos map[string][]token.Position
240233
pkg go/build, type Package struct, XTestEmbedPatterns []string
234+
pkg go/build, type Package struct, XTestEmbedPatternPos map[string][]token.Position
241235
pkg html/template, func ParseFS(fs.FS, ...string) (*Template, error)
242236
pkg html/template, method (*Template) ParseFS(fs.FS, ...string) (*Template, error)
243237
pkg io, func NopCloser(Reader) ReadCloser
@@ -404,7 +398,6 @@ pkg runtime/metrics, type Description struct, Cumulative bool
404398
pkg runtime/metrics, type Description struct, Description string
405399
pkg runtime/metrics, type Description struct, Kind ValueKind
406400
pkg runtime/metrics, type Description struct, Name string
407-
pkg runtime/metrics, type Description struct, StopTheWorld bool
408401
pkg runtime/metrics, type Float64Histogram struct
409402
pkg runtime/metrics, type Float64Histogram struct, Buckets []float64
410403
pkg runtime/metrics, type Float64Histogram struct, Counts []uint64
@@ -437,10 +430,8 @@ pkg syscall (linux-arm-cgo), func AllThreadsSyscall(uintptr, uintptr, uintptr, u
437430
pkg syscall (linux-arm-cgo), func AllThreadsSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
438431
pkg syscall (linux-arm-cgo), func Setegid(int) error
439432
pkg syscall (linux-arm-cgo), func Seteuid(int) error
440-
pkg syscall (windows-386), func RtlGenRandom(*uint8, uint32) error
441433
pkg syscall (windows-386), method (*DLLError) Unwrap() error
442434
pkg syscall (windows-386), type SysProcAttr struct, NoInheritHandles bool
443-
pkg syscall (windows-amd64), func RtlGenRandom(*uint8, uint32) error
444435
pkg syscall (windows-amd64), method (*DLLError) Unwrap() error
445436
pkg syscall (windows-amd64), type SysProcAttr struct, NoInheritHandles bool
446437
pkg testing/fstest, func TestFS(fs.FS, ...string) error

doc/editors.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ <h2 id="options">Options</h2>
1919
</p>
2020

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

3028
<p>
3129
Note that these are only a few top solutions; a more comprehensive

doc/go1.16.html

Lines changed: 92 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ <h4 id="modules">Modules</h4>
164164
non-reproducible builds.
165165
</p>
166166

167+
<p><!-- golang.org/issue/43052 -->
168+
The <code>go</code> command now disallows non-ASCII import paths in module
169+
mode. Non-ASCII module paths have already been disallowed so this change
170+
affects module subdirectory paths that contain non-ASCII characters.
171+
</p>
172+
167173
<h4 id="embed">Embedding Files</h4>
168174

169175
<p>
@@ -506,6 +512,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
506512
in mind.
507513
</p>
508514

515+
<dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
516+
<dd>
517+
<p><!-- CL 243937 -->
518+
The new <a href="/pkg/archive/zip/#Reader.Open"><code>Reader.Open</code></a>
519+
method implements the <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>
520+
interface.
521+
</p>
522+
</dd>
523+
</dl>
524+
509525
<dl id="crypto/dsa"><dt><a href="/pkg/crypto/dsa/">crypto/dsa</a></dt>
510526
<dd>
511527
<p><!-- CL 257939 -->
@@ -590,14 +606,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
590606
a malformed certificate.
591607
</p>
592608

593-
<p><!-- CL 233163 -->
594-
A number of additional fields have been added to the
595-
<a href="/pkg/crypto/x509/#CertificateRequest"><code>CertificateRequest</code></a> type.
596-
These fields are now parsed in <a href="/pkg/crypto/x509/#ParseCertificateRequest">
597-
<code>ParseCertificateRequest</code></a> and marshalled in
598-
<a href="/pkg/crypto/x509/#CreateCertificateRequest"><code>CreateCertificateRequest</code></a>.
599-
</p>
600-
601609
<p><!-- CL 257939 -->
602610
DSA signature verification is no longer supported. Note that DSA signature
603611
generation was never supported.
@@ -618,6 +626,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
618626
</dd>
619627
</dl><!-- crypto/x509 -->
620628

629+
<dl id="debug/elf"><dt><a href="/pkg/debug/elf/">debug/elf</a></dt>
630+
<dd>
631+
<p><!-- CL 255138 -->
632+
More <a href="/pkg/debug/elf/#DT_NULL"><code>DT</code></a>
633+
and <a href="/pkg/debug/elf/#PT_NULL"><code>PT</code></a>
634+
constants have been added.
635+
</p>
636+
</dd>
637+
</dl><!-- debug/elf -->
638+
621639
<dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1">encoding/asn1</a></dt>
622640
<dd>
623641
<p><!-- CL 255881 -->
@@ -667,6 +685,18 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
667685
</dd>
668686
</dl><!-- flag -->
669687

688+
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
689+
<dd>
690+
<p><!-- CL 243938 -->
691+
The new <a href="/pkg/html/template/#ParseFS"><code>template.ParseFS</code></a>
692+
function and <a href="/pkg/html/template/#Template.ParseFS"><code>template.Template.ParseFS</code></a>
693+
method are like <a href="/pkg/html/template/#ParseGlob"><code>template.ParseGlob</code></a>
694+
and <a href="/pkg/html/template/#Template.ParseGlob"><code>template.Template.ParseGlob</code></a>,
695+
but read the templates from an <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>.
696+
</p>
697+
</dd>
698+
</dl><!-- html/template -->
699+
670700
<dl id="io"><dt><a href="/pkg/io/">io</a></dt>
671701
<dd>
672702
<p><!-- CL 261577 -->
@@ -776,6 +806,25 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
776806
environment variable for <code>https://</code> URLs when
777807
<code>HTTPS_PROXY</code> is unset.
778808
</p>
809+
810+
<p><!-- 259917 -->
811+
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
812+
type has a new field
813+
<a href="/pkg/net/http/#Transport.GetProxyConnectHeader"><code>GetProxyConnectHeader</code></a>
814+
which may be set to a function that returns headers to send to a
815+
proxy during a <code>CONNECT</code> request.
816+
In effect <code>GetProxyConnectHeader</code> is a dynamic
817+
version of the existing field
818+
<a href="/pkg/net/http/#Transport.ProxyConnectHeader"><code>ProxyConnectHeader</code></a>;
819+
if <code>GetProxyConnectHeader</code> is not <code>nil</code>,
820+
then <code>ProxyConnectHeader</code> is ignored.
821+
</p>
822+
823+
<p><!-- CL 243939 -->
824+
The new <a href="/pkg/net/http/#FS"><code>http.FS</code></a>
825+
function converts an <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>
826+
to an <a href="/pkg/net/http/#Handler"><code>http.Handler</code></a>.
827+
</p>
779828
</dd>
780829
</dl><!-- net/http -->
781830

@@ -836,6 +885,21 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
836885

837886
<dl id="path/filepath"><dt><a href="/pkg/path/filepath/">path/filepath</a></dt>
838887
<dd>
888+
<p><!-- CL 267887 -->
889+
The new function
890+
<a href="/pkg/path/filepath/WalkDir"><code>WalkDir</code></a>
891+
is similar to
892+
<a href="/pkg/path/filepath/Walk"><code>Walk</code></a>,
893+
but is typically more efficient.
894+
The function passed to <code>WalkDir</code> receives a
895+
<a href="/pkg/io/fs/#DirEntry"><code>fs.DirEntry</code></a>
896+
instead of a
897+
<a href="/pkg/io/fs/#FileInfo"><code>fs.FileInfo</code></a>.
898+
(To clarify for those who recall the <code>Walk</code> function
899+
as taking an <a href="/pkg/os/#FileInfo"><code>os.FileInfo</code></a>,
900+
<code>os.FileInfo</code> is now an alias for <code>fs.FileInfo</code>.)
901+
</p>
902+
839903
<p><!-- CL 264397, golang.org/issues/28614 -->
840904
The <a href="/pkg/path/filepath#Match"><code>Match</code></a> and
841905
<a href="/pkg/path/filepath#Glob"><code>Glob</code></a> functions now
@@ -847,17 +911,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
847911
</dd>
848912
</dl><!-- path/filepath -->
849913

850-
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
851-
<dd>
852-
<p><!-- CL 248341, golang.org/issues/40281 -->
853-
<a href="/pkg/reflect/#StructTag"><code>StructTag</code></a>
854-
now allows multiple space-separated keys in key:value pairs,
855-
as in <code>`json xml:"field1"`</code> (equivalent to
856-
<code>`json:"field1" xml:"field1"`</code>).
857-
</p>
858-
</dd>
859-
</dl><!-- reflect -->
860-
861914
<dl id="runtime/debug"><dt><a href="/pkg/runtime/debug/">runtime/debug</a></dt>
862915
<dd>
863916
<p><!-- CL 249677 -->
@@ -895,11 +948,11 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
895948
</p>
896949

897950
<p><!-- CL 261917 -->
898-
<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.
951+
<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.
899952
</p>
900953

901954
<p><!-- CL 269761, golang.org/issue/42584 -->
902-
<a href="/pkg/syscall/?GOOS=windows#DLLError"><code>DLLError</code></a> on Windows now has an Unwrap function for unwrapping its underlying error.
955+
<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.
903956
</p>
904957

905958
<p><!-- CL 210639 -->
@@ -909,6 +962,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
909962
and related calls are now implemented.
910963
Previously, they returned an <code>syscall.EOPNOTSUPP</code> error.
911964
</p>
965+
966+
<p><!-- CL 210639 -->
967+
On Linux, the new functions
968+
<a href="/pkg/syscall/#AllThreadsSyscall"><code>AllThreadsSyscall</code></a>
969+
and <a href="/pkg/syscall/#AllThreadsSyscall6"><code>AllThreadsSyscall6</code></a>
970+
may be used to make a system call on all Go threads in the process.
971+
These functions may only be used by programs that do not use cgo;
972+
if a program uses cgo, they will always return
973+
<a href="/pkg/syscall/#ENOTSUP"><code>syscall.ENOTSUP</code></a>.
974+
</p>
912975
</dd>
913976
</dl><!-- syscall -->
914977

@@ -918,6 +981,14 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
918981
Newlines characters are now allowed inside action delimiters,
919982
permitting actions to span multiple lines.
920983
</p>
984+
985+
<p><!-- CL 243938 -->
986+
The new <a href="/pkg/text/template/#ParseFS"><code>template.ParseFS</code></a>
987+
function and <a href="/pkg/text/template/#Template.ParseFS"><code>template.Template.ParseFS</code></a>
988+
method are like <a href="/pkg/text/template/#ParseGlob"><code>template.ParseGlob</code></a>
989+
and <a href="/pkg/text/template/#Template.ParseGlob"><code>template.Template.ParseGlob</code></a>,
990+
but read the templates from an <a href="/pkg/io/fs/#FS"><code>fs.FS</code></a>.
991+
</p>
921992
</dd>
922993
</dl><!-- text/template -->
923994

src/archive/tar/strconv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func isASCII(s string) bool {
2828
}
2929

3030
// toASCII converts the input to an ASCII C-style string.
31-
// This a best effort conversion, so invalid characters are dropped.
31+
// This is a best effort conversion, so invalid characters are dropped.
3232
func toASCII(s string) string {
3333
if isASCII(s) {
3434
return s

src/cmd/api/goapi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import (
1616
"go/parser"
1717
"go/token"
1818
"go/types"
19+
exec "internal/execabs"
1920
"io"
2021
"log"
2122
"os"
22-
"os/exec"
2323
"path/filepath"
2424
"regexp"
2525
"runtime"

src/cmd/api/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ package main
1010

1111
import (
1212
"fmt"
13+
exec "internal/execabs"
1314
"log"
1415
"os"
15-
"os/exec"
1616
"path/filepath"
1717
"runtime"
1818
"strings"

src/cmd/cgo/gcc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,14 @@ func (p *Package) gccBaseCmd() []string {
15491549
func (p *Package) gccMachine() []string {
15501550
switch goarch {
15511551
case "amd64":
1552+
if goos == "darwin" {
1553+
return []string{"-arch", "x86_64", "-m64"}
1554+
}
15521555
return []string{"-m64"}
1556+
case "arm64":
1557+
if goos == "darwin" {
1558+
return []string{"-arch", "arm64"}
1559+
}
15531560
case "386":
15541561
return []string{"-m32"}
15551562
case "arm":

src/cmd/cgo/out.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
"go/ast"
1515
"go/printer"
1616
"go/token"
17+
exec "internal/execabs"
1718
"internal/xcoff"
1819
"io"
1920
"os"
20-
"os/exec"
2121
"path/filepath"
2222
"regexp"
2323
"sort"
@@ -953,9 +953,9 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
953953
// Build the wrapper function compiled by gcc.
954954
gccExport := ""
955955
if goos == "windows" {
956-
gccExport = "__declspec(dllexport)"
956+
gccExport = "__declspec(dllexport) "
957957
}
958-
s := fmt.Sprintf("%s %s %s(", gccExport, gccResult, exp.ExpName)
958+
s := fmt.Sprintf("%s%s %s(", gccExport, gccResult, exp.ExpName)
959959
if fn.Recv != nil {
960960
s += p.cgoType(fn.Recv.List[0].Type).C.String()
961961
s += " recv"

src/cmd/cgo/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"bytes"
99
"fmt"
1010
"go/token"
11+
exec "internal/execabs"
1112
"io/ioutil"
1213
"os"
13-
"os/exec"
1414
)
1515

1616
// run runs the command argv, feeding in stdin on standard input.
@@ -63,7 +63,7 @@ func run(stdin []byte, argv []string) (stdout, stderr []byte, ok bool) {
6363
p.Env = append(os.Environ(), "TERM=dumb")
6464
err := p.Run()
6565
if _, ok := err.(*exec.ExitError); err != nil && !ok {
66-
fatalf("%s", err)
66+
fatalf("exec %s: %s", argv[0], err)
6767
}
6868
ok = p.ProcessState.Success()
6969
stdout, stderr = bout.Bytes(), berr.Bytes()
@@ -88,7 +88,7 @@ func fatalf(msg string, args ...interface{}) {
8888
// If we've already printed other errors, they might have
8989
// caused the fatal condition. Assume they're enough.
9090
if nerrors == 0 {
91-
fmt.Fprintf(os.Stderr, msg+"\n", args...)
91+
fmt.Fprintf(os.Stderr, "cgo: "+msg+"\n", args...)
9292
}
9393
os.Exit(2)
9494
}

src/cmd/compile/internal/arm64/ssa.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,11 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
10541054
ssa.OpARM64LessThanF,
10551055
ssa.OpARM64LessEqualF,
10561056
ssa.OpARM64GreaterThanF,
1057-
ssa.OpARM64GreaterEqualF:
1057+
ssa.OpARM64GreaterEqualF,
1058+
ssa.OpARM64NotLessThanF,
1059+
ssa.OpARM64NotLessEqualF,
1060+
ssa.OpARM64NotGreaterThanF,
1061+
ssa.OpARM64NotGreaterEqualF:
10581062
// generate boolean values using CSET
10591063
p := s.Prog(arm64.ACSET)
10601064
p.From.Type = obj.TYPE_REG // assembler encodes conditional bits in Reg
@@ -1098,10 +1102,16 @@ var condBits = map[ssa.Op]int16{
10981102
ssa.OpARM64GreaterThanU: arm64.COND_HI,
10991103
ssa.OpARM64GreaterEqual: arm64.COND_GE,
11001104
ssa.OpARM64GreaterEqualU: arm64.COND_HS,
1101-
ssa.OpARM64LessThanF: arm64.COND_MI,
1102-
ssa.OpARM64LessEqualF: arm64.COND_LS,
1103-
ssa.OpARM64GreaterThanF: arm64.COND_GT,
1104-
ssa.OpARM64GreaterEqualF: arm64.COND_GE,
1105+
ssa.OpARM64LessThanF: arm64.COND_MI, // Less than
1106+
ssa.OpARM64LessEqualF: arm64.COND_LS, // Less than or equal to
1107+
ssa.OpARM64GreaterThanF: arm64.COND_GT, // Greater than
1108+
ssa.OpARM64GreaterEqualF: arm64.COND_GE, // Greater than or equal to
1109+
1110+
// The following condition codes have unordered to handle comparisons related to NaN.
1111+
ssa.OpARM64NotLessThanF: arm64.COND_PL, // Greater than, equal to, or unordered
1112+
ssa.OpARM64NotLessEqualF: arm64.COND_HI, // Greater than or unordered
1113+
ssa.OpARM64NotGreaterThanF: arm64.COND_LE, // Less than, equal to or unordered
1114+
ssa.OpARM64NotGreaterEqualF: arm64.COND_LT, // Less than or unordered
11051115
}
11061116

11071117
var blockJump = map[ssa.BlockKind]struct {

0 commit comments

Comments
 (0)