src/cmd/go/internal/modfetch/toolchain.go | 10 ++++++++++ src/cmd/link/internal/loadpe/ldpe.go | 2 +- src/internal/coverage/cmerge/merge.go | 2 +- src/internal/diff/diff.go | 2 +- src/internal/testenv/exec.go | 4 ++-- src/os/error.go | 2 +- src/runtime/metrics.go | 2 +- src/runtime/mgcscavenge.go | 2 +- diff --git a/src/cmd/go/internal/modfetch/toolchain.go b/src/cmd/go/internal/modfetch/toolchain.go index 1669ab92e701185bf0ff3a797aabf097ac6dbcd6..0d7cfcfe7d10734caa8c4616cf7492b13b21a855 100644 --- a/src/cmd/go/internal/modfetch/toolchain.go +++ b/src/cmd/go/internal/modfetch/toolchain.go @@ -98,13 +98,23 @@ 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 0a610ff048328d57558aa8243d21435002964dec..81c28415a2c21d2d70dbdb9821234a1dd70f82fb 100644 --- a/src/cmd/link/internal/loadpe/ldpe.go +++ b/src/cmd/link/internal/loadpe/ldpe.go @@ -222,7 +222,7 @@ // is symbol size (or -1 if we're using the "any" strategy). 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 16fa1e8c387927e24d5d5dccafc931b6bc5e4eb7..1339803d0865c6dc37ceadf4c3e2dc101e27da8f 100644 --- a/src/internal/coverage/cmerge/merge.go +++ b/src/internal/coverage/cmerge/merge.go @@ -68,7 +68,7 @@ } 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 47b285671454ed9ace89cb7b24568abc47c48243..0aeeb75eb096cb90437ddb0800463f82a33d52bd 100644 --- a/src/internal/diff/diff.go +++ b/src/internal/diff/diff.go @@ -76,7 +76,7 @@ } // 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 c67ff53a72924ca1603b7dad9235fae40ad7669d..50d3b0dc73131ca7c8ae0a2688723efbd5200a69 100644 --- a/src/internal/testenv/exec.go +++ b/src/internal/testenv/exec.go @@ -163,8 +163,8 @@ // When we run commands that execute subprocesses, we want to reserve two // 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 9827446e65c060a6509ef0f66fd2d307ca85343c..62ede9ded3bcec749b9ccd9978b86af0a1e69604 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 4cd447a70c98c2798bcb9642b86030fab6277899..8ef1b022cfdc6519b6bfe8dbdf9179b6deff6f6c 100644 --- a/src/runtime/metrics.go +++ b/src/runtime/metrics.go @@ -660,7 +660,7 @@ // 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 10e93a13d38635cf90652d0a67e7526879225477..82a94be22a7ea51479136617db23f89ac873f40c 100644 --- a/src/runtime/mgcscavenge.go +++ b/src/runtime/mgcscavenge.go @@ -884,7 +884,7 @@ // findScavengeCandidate returns a start index and a size for this pallocData // 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,