diff options
author | Cherry Mui <cherryyz@google.com> | 2023-07-13 12:46:25 -0400 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2023-07-13 12:46:26 -0400 |
commit | 9480b4adf9cbb06ff4458470eecca2b849a201b6 (patch) | |
tree | 67dbe18e33d422d38b6ed4aac81f1c2a82e1d80d | |
parent | cc0cb3020dee801d733bc9c20c4a5bbaa650a6d4 (diff) | |
parent | b88bd917b8dd8aabc471b1de41b3ee8c0d6eeabe (diff) | |
download | go-9480b4adf9cbb06ff4458470eecca2b849a201b6.tar.gz go-9480b4adf9cbb06ff4458470eecca2b849a201b6.zip |
[release-branch.go1.21] all: merge master (b88bd91) into release-branch.go1.21
Merge List:
+ 2023-07-13 b88bd917b8 cmd/go/internal/modfetch: always allow Stat for the current toolchain to succeed
+ 2023-07-13 d4f0d896a6 net/http: revert stray edit to h2_bundle.go from CL 508996
+ 2023-07-13 4a0f51696e all: remove duplicate word and fix comment
+ 2023-07-12 49d42128fd all: fix typos and remove repeated words
Change-Id: Ie4f17f633483d5cd1d244b6e7cde6422dc246d9e
-rw-r--r-- | src/cmd/go/internal/modfetch/toolchain.go | 10 | ||||
-rw-r--r-- | src/cmd/link/internal/loadpe/ldpe.go | 2 | ||||
-rw-r--r-- | src/internal/coverage/cmerge/merge.go | 2 | ||||
-rw-r--r-- | src/internal/diff/diff.go | 2 | ||||
-rw-r--r-- | src/internal/testenv/exec.go | 4 | ||||
-rw-r--r-- | src/os/error.go | 2 | ||||
-rw-r--r-- | src/runtime/metrics.go | 2 | ||||
-rw-r--r-- | src/runtime/mgcscavenge.go | 2 |
8 files changed, 18 insertions, 8 deletions
diff --git a/src/cmd/go/internal/modfetch/toolchain.go b/src/cmd/go/internal/modfetch/toolchain.go index 1669ab92e7..0d7cfcfe7d 100644 --- a/src/cmd/go/internal/modfetch/toolchain.go +++ b/src/cmd/go/internal/modfetch/toolchain.go @@ -98,13 +98,23 @@ func (r *toolchainRepo) Stat(ctx context.Context, rev string) (*RevInfo, error) if !gover.IsValid(v) { return nil, fmt.Errorf("invalid %s version %s", r.path, rev) } + // If we're asking about "go" (not "toolchain"), pretend to have // all earlier Go versions available without network access: // we will provide those ourselves, at least in GOTOOLCHAIN=auto mode. if r.path == "go" && gover.Compare(v, gover.Local()) <= 0 { return &RevInfo{Version: prefix + v}, nil } + + // Similarly, if we're asking about *exactly* the current toolchain, + // we don't need to access the network to know that it exists. + if r.path == "toolchain" && v == gover.Local() { + return &RevInfo{Version: prefix + v}, nil + } + if gover.IsLang(v) { + // We can only use a language (development) version if the current toolchain + // implements that version, and the two checks above have ruled that out. return nil, fmt.Errorf("go language version %s is not a toolchain version", rev) } diff --git a/src/cmd/link/internal/loadpe/ldpe.go b/src/cmd/link/internal/loadpe/ldpe.go index 0a610ff048..81c28415a2 100644 --- a/src/cmd/link/internal/loadpe/ldpe.go +++ b/src/cmd/link/internal/loadpe/ldpe.go @@ -222,7 +222,7 @@ type peLoaderState struct { var comdatDefinitions = make(map[string]int64) // Load loads the PE file pn from input. -// Symbols from the object file are created via the loader 'l', and +// Symbols from the object file are created via the loader 'l', // and a slice of the text symbols is returned. // If an .rsrc section or set of .rsrc$xx sections is found, its symbols are // returned as rsrc. diff --git a/src/internal/coverage/cmerge/merge.go b/src/internal/coverage/cmerge/merge.go index 16fa1e8c38..1339803d08 100644 --- a/src/internal/coverage/cmerge/merge.go +++ b/src/internal/coverage/cmerge/merge.go @@ -68,7 +68,7 @@ func (m *Merger) SaturatingAdd(dst, src uint32) uint32 { return result } -// Saturating add does a saturing addition of 'dst' and 'src', +// Saturating add does a saturating addition of 'dst' and 'src', // returning added value or math.MaxUint32 plus an overflow flag. func SaturatingAdd(dst, src uint32) (uint32, bool) { d, s := uint64(dst), uint64(src) diff --git a/src/internal/diff/diff.go b/src/internal/diff/diff.go index 47b2856714..0aeeb75eb0 100644 --- a/src/internal/diff/diff.go +++ b/src/internal/diff/diff.go @@ -76,7 +76,7 @@ func Diff(oldName string, old []byte, newName string, new []byte) []byte { // Expand matching lines as far possible, // establishing that x[start.x:end.x] == y[start.y:end.y]. - // Note that on the first (or last) iteration we may (or definitey do) + // Note that on the first (or last) iteration we may (or definitely do) // have an empty match: start.x==end.x and start.y==end.y. start := m for start.x > done.x && start.y > done.y && x[start.x-1] == y[start.y-1] { diff --git a/src/internal/testenv/exec.go b/src/internal/testenv/exec.go index c67ff53a72..50d3b0dc73 100644 --- a/src/internal/testenv/exec.go +++ b/src/internal/testenv/exec.go @@ -163,8 +163,8 @@ func CommandContext(t testing.TB, ctx context.Context, name string, args ...stri // grace periods to clean up: one for the delay between the first // termination signal being sent (via the Cancel callback when the Context // expires) and the process being forcibly terminated (via the WaitDelay - // field), and a second one for the delay becween the process being - // terminated and and the test logging its output for debugging. + // field), and a second one for the delay between the process being + // terminated and the test logging its output for debugging. // // (We want to ensure that the test process itself has enough time to // log the output before it is also terminated.) diff --git a/src/os/error.go b/src/os/error.go index 9827446e65..62ede9ded3 100644 --- a/src/os/error.go +++ b/src/os/error.go @@ -31,7 +31,7 @@ func errNoDeadline() error { return poll.ErrNoDeadline } // errDeadlineExceeded returns the value for os.ErrDeadlineExceeded. // This error comes from the internal/poll package, which is also -// used by package net. Doing this this way ensures that the net +// used by package net. Doing it this way ensures that the net // package will return os.ErrDeadlineExceeded for an exceeded deadline, // as documented by net.Conn.SetDeadline, without requiring any extra // work in the net package and without requiring the internal/poll diff --git a/src/runtime/metrics.go b/src/runtime/metrics.go index 4cd447a70c..8ef1b022cf 100644 --- a/src/runtime/metrics.go +++ b/src/runtime/metrics.go @@ -660,7 +660,7 @@ type cpuStatsAggregate struct { // compute populates the cpuStatsAggregate with values from the runtime. func (a *cpuStatsAggregate) compute() { a.cpuStats = work.cpuStats - // TODO(mknyszek): Update the the CPU stats again so that we're not + // TODO(mknyszek): Update the CPU stats again so that we're not // just relying on the STW snapshot. The issue here is that currently // this will cause non-monotonicity in the "user" CPU time metric. // diff --git a/src/runtime/mgcscavenge.go b/src/runtime/mgcscavenge.go index 10e93a13d3..82a94be22a 100644 --- a/src/runtime/mgcscavenge.go +++ b/src/runtime/mgcscavenge.go @@ -884,7 +884,7 @@ func fillAligned(x uint64, m uint) uint64 { // segment which represents a contiguous region of free and unscavenged memory. // // searchIdx indicates the page index within this chunk to start the search, but -// note that findScavengeCandidate searches backwards through the pallocData. As a +// note that findScavengeCandidate searches backwards through the pallocData. As // a result, it will return the highest scavenge candidate in address order. // // min indicates a hard minimum size and alignment for runs of pages. That is, |