Skip to content

Commit c2de683

Browse files
committed
[release-branch.go1.21] all: merge master (2639a17) into release-branch.go1.21
Change-Id: I316578aec6c2b618c840d43a65ef87b8d2168ac0
2 parents 4aeac32 + 2639a17 commit c2de683

File tree

19 files changed

+217
-112
lines changed

19 files changed

+217
-112
lines changed

doc/go1.21.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ <h2 id="assembler">Assembler</h2>
328328
<h2 id="linker">Linker</h2>
329329

330330
<p><!-- https://go.dev/issue/57302, CL 461749, CL 457455 -->
331-
On Windows AMD64, the linker (with help from the compiler) now emits
331+
On windows/amd64, the linker (with help from the compiler) now emits
332332
SEH unwinding data by default, which improves the integration
333333
of Go applications with Windows debuggers and other tools.
334334
</p>
@@ -346,8 +346,8 @@ <h2 id="library">Core library</h2>
346346
<h3 id="slog">New log/slog package</h3>
347347

348348
<p><!-- https://go.dev/issue/59060, https://go.dev/issue/59141, https://go.dev/issue/59204, https://go.dev/issue/59280,
349-
https://go.dev/issue/59282, https://go.dev/issue/59339, https://go.dev/issue/59345,
350-
CL 477295, CL 484096, CL 486376, CL 486415, CL 487855 -->
349+
https://go.dev/issue/59282, https://go.dev/issue/59339, https://go.dev/issue/59345, https://go.dev/issue/61200,
350+
CL 477295, CL 484096, CL 486376, CL 486415, CL 487855, CL 508195 -->
351351
The new <a href="/pkg/log/slog">log/slog</a> package provides structured logging with levels.
352352
Structured logging emits key-value pairs
353353
to enable fast, accurate processing of large amounts of log data.
@@ -367,7 +367,8 @@ <h3 id="slices">New slices package</h3>
367367
<!-- https://go.dev/issue/45955, https://go.dev/issue/54768 -->
368368
<!-- https://go.dev/issue/57348, https://go.dev/issue/57433 -->
369369
<!-- https://go.dev/issue/58565, https://go.dev/issue/60091 -->
370-
<!-- CL 467417, CL 468855, CL 483175, CL 496078, CL 498175 -->
370+
<!-- https://go.dev/issue/60546 -->
371+
<!-- CL 467417, CL 468855, CL 483175, CL 496078, CL 498175, CL 502955 -->
371372
The new <a href="/pkg/slices">slices</a> package provides many common
372373
operations on slices, using generic functions that work with slices
373374
of any element type.
@@ -755,6 +756,14 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
755756
</dd>
756757
</dl><!-- go/token -->
757758

759+
<dl id="go/types"><dt><a href="/pkg/go/types/">go/types</a></dt>
760+
<dd>
761+
<p><!-- https://go.dev/issue/61175, CL 507975 -->
762+
TODO: <a href="https://go.dev/cl/507975">https://go.dev/cl/507975</a>: go/types: record Config.GoVersion for reporting in Package.GoVersion method; modified api/go1.21.txt
763+
</p>
764+
</dd>
765+
</dl><!-- go/types -->
766+
758767
<dl id="hash/maphash"><dt><a href="/pkg/hash/maphash/">hash/maphash</a></dt>
759768
<dd>
760769
<p><!-- https://go.dev/issue/47342, CL 468795 -->
@@ -1235,18 +1244,21 @@ <h3 id="PPC64">ppc64/ppc64le</h3>
12351244
<code>c-archive</code>, <code>c-shared</code>, <code>shared</code>, <code>pie</code>, <code>plugin</code>.
12361245
</p>
12371246

1238-
12391247
<!-- proposals for x repos that don't need to be mentioned here but
12401248
are picked up by the relnote tool. -->
12411249
<!-- https://go.dev/issue/54232 -->
1250+
<!-- https://go.dev/issue/57051 -->
12421251
<!-- https://go.dev/issue/57792 -->
12431252
<!-- https://go.dev/issue/57906 -->
12441253
<!-- https://go.dev/issue/58668 -->
1254+
<!-- https://go.dev/issue/59016 -->
12451255
<!-- https://go.dev/issue/59676 -->
1256+
<!-- https://go.dev/issue/60409 -->
1257+
<!-- https://go.dev/issue/61176 -->
12461258

12471259
<!-- changes to cmd/api that don't need release notes. -->
12481260
<!-- CL 469115, CL 469135, CL 499981 -->
12491261

1250-
<!-- proposals that don't need release enotes. -->
1262+
<!-- proposals that don't need release notes. -->
12511263
<!-- https://go.dev/issue/10275 -->
12521264
<!-- https://go.dev/issue/59719 -->

src/bytes/compare_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package bytes_test
77
import (
88
. "bytes"
99
"fmt"
10-
"internal/testenv"
1110
"testing"
1211
)
1312

@@ -73,7 +72,7 @@ func TestCompareBytes(t *testing.T) {
7372
}
7473
lengths = append(lengths, 256, 512, 1024, 1333, 4095, 4096, 4097)
7574

76-
if !testing.Short() || testenv.Builder() != "" {
75+
if !testing.Short() {
7776
lengths = append(lengths, 65535, 65536, 65537, 99999)
7877
}
7978

src/cmd/compile/internal/types2/const.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func representableConst(x constant.Value, check *Checker, typ *Basic, rounded *c
7373

7474
sizeof := func(T Type) int64 {
7575
s := conf.sizeof(T)
76-
assert(s == 4 || s == 8)
7776
return s
7877
}
7978

src/cmd/covdata/doc.go

Lines changed: 73 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3,82 +3,78 @@
33
// license that can be found in the LICENSE file.
44

55
/*
6-
//
7-
// Covdata is a program for manipulating and generating reports
8-
// from 2nd-generation coverage testing output files, those produced
9-
// from running applications or integration tests. E.g.
10-
//
11-
// $ mkdir ./profiledir
12-
// $ go build -cover -o myapp.exe .
13-
// $ GOCOVERDIR=./profiledir ./myapp.exe <arguments>
14-
// $ ls ./profiledir
15-
// covcounters.cce1b350af34b6d0fb59cc1725f0ee27.821598.1663006712821344241
16-
// covmeta.cce1b350af34b6d0fb59cc1725f0ee27
17-
// $
18-
//
19-
// Run covdata via "go tool covdata <mode>", where 'mode' is a subcommand
20-
// selecting a specific reporting, merging, or data manipulation operation.
21-
// Descriptions on the various modes (run "go tool cover <mode> -help" for
22-
// specifics on usage of a given mode:
23-
//
24-
// 1. Report percent of statements covered in each profiled package
25-
//
26-
// $ go tool covdata percent -i=profiledir
27-
// cov-example/p coverage: 41.1% of statements
28-
// main coverage: 87.5% of statements
29-
// $
30-
//
31-
//
32-
// 2. Report import paths of packages profiled
33-
//
34-
// $ go tool covdata pkglist -i=profiledir
35-
// cov-example/p
36-
// main
37-
// $
38-
//
39-
// 3. Report percent statements covered by function:
40-
//
41-
// $ go tool covdata func -i=profiledir
42-
// cov-example/p/p.go:12: emptyFn 0.0%
43-
// cov-example/p/p.go:32: Small 100.0%
44-
// cov-example/p/p.go:47: Medium 90.9%
45-
// ...
46-
// $
47-
//
48-
// 4. Convert coverage data to legacy textual format:
49-
//
50-
// $ go tool covdata textfmt -i=profiledir -o=cov.txt
51-
// $ head cov.txt
52-
// mode: set
53-
// cov-example/p/p.go:12.22,13.2 0 0
54-
// cov-example/p/p.go:15.31,16.2 1 0
55-
// cov-example/p/p.go:16.3,18.3 0 0
56-
// cov-example/p/p.go:19.3,21.3 0 0
57-
// ...
58-
// $ go tool cover -html=cov.txt
59-
// $
60-
//
61-
// 5. Merge profiles together:
62-
//
63-
// $ go tool covdata merge -i=indir1,indir2 -o=outdir -modpaths=github.com/go-delve/delve
64-
// $
65-
//
66-
// 6. Subtract one profile from another
67-
//
68-
// $ go tool covdata subtract -i=indir1,indir2 -o=outdir
69-
// $
70-
//
71-
// 7. Intersect profiles
72-
//
73-
// $ go tool covdata intersect -i=indir1,indir2 -o=outdir
74-
// $
75-
//
76-
// 8. Dump a profile for debugging purposes.
77-
//
78-
// $ go tool covdata debugdump -i=indir
79-
// <human readable output>
80-
// $
81-
//
82-
*/
6+
Covdata is a program for manipulating and generating reports
7+
from 2nd-generation coverage testing output files, those produced
8+
from running applications or integration tests. E.g.
9+
10+
$ mkdir ./profiledir
11+
$ go build -cover -o myapp.exe .
12+
$ GOCOVERDIR=./profiledir ./myapp.exe <arguments>
13+
$ ls ./profiledir
14+
covcounters.cce1b350af34b6d0fb59cc1725f0ee27.821598.1663006712821344241
15+
covmeta.cce1b350af34b6d0fb59cc1725f0ee27
16+
$
17+
18+
Run covdata via "go tool covdata <mode>", where 'mode' is a subcommand
19+
selecting a specific reporting, merging, or data manipulation operation.
20+
Descriptions on the various modes (run "go tool cover <mode> -help" for
21+
specifics on usage of a given mode:
22+
23+
1. Report percent of statements covered in each profiled package
24+
25+
$ go tool covdata percent -i=profiledir
26+
cov-example/p coverage: 41.1% of statements
27+
main coverage: 87.5% of statements
28+
$
29+
30+
2. Report import paths of packages profiled
31+
32+
$ go tool covdata pkglist -i=profiledir
33+
cov-example/p
34+
main
35+
$
36+
37+
3. Report percent statements covered by function:
38+
39+
$ go tool covdata func -i=profiledir
40+
cov-example/p/p.go:12: emptyFn 0.0%
41+
cov-example/p/p.go:32: Small 100.0%
42+
cov-example/p/p.go:47: Medium 90.9%
43+
...
44+
$
45+
46+
4. Convert coverage data to legacy textual format:
8347
48+
$ go tool covdata textfmt -i=profiledir -o=cov.txt
49+
$ head cov.txt
50+
mode: set
51+
cov-example/p/p.go:12.22,13.2 0 0
52+
cov-example/p/p.go:15.31,16.2 1 0
53+
cov-example/p/p.go:16.3,18.3 0 0
54+
cov-example/p/p.go:19.3,21.3 0 0
55+
...
56+
$ go tool cover -html=cov.txt
57+
$
58+
59+
5. Merge profiles together:
60+
61+
$ go tool covdata merge -i=indir1,indir2 -o=outdir -modpaths=github.com/go-delve/delve
62+
$
63+
64+
6. Subtract one profile from another
65+
66+
$ go tool covdata subtract -i=indir1,indir2 -o=outdir
67+
$
68+
69+
7. Intersect profiles
70+
71+
$ go tool covdata intersect -i=indir1,indir2 -o=outdir
72+
$
73+
74+
8. Dump a profile for debugging purposes.
75+
76+
$ go tool covdata debugdump -i=indir
77+
<human readable output>
78+
$
79+
*/
8480
package main

src/cmd/go/scriptconds_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func scriptConditions() map[string]script.Cond {
4949
add("git", lazyBool("the 'git' executable exists and provides the standard CLI", hasWorkingGit))
5050
add("GODEBUG", script.PrefixCondition("GODEBUG contains <suffix>", hasGodebug))
5151
add("GOEXPERIMENT", script.PrefixCondition("GOEXPERIMENT <suffix> is enabled", hasGoexperiment))
52+
add("go-builder", script.BoolCondition("GO_BUILDER_NAME is non-empty", testenv.Builder() != ""))
5253
add("link", lazyBool("testenv.HasLink()", testenv.HasLink))
5354
add("mismatched-goroot", script.Condition("test's GOROOT_FINAL does not match the real GOROOT", isMismatchedGoroot))
5455
add("msan", sysCondition("-msan", platform.MSanSupported, true))

src/cmd/go/testdata/script/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ The available conditions are:
398398
GOOS/GOARCH supports -fuzz with instrumentation
399399
[git]
400400
the 'git' executable exists and provides the standard CLI
401+
[go-builder]
402+
GO_BUILDER_NAME is non-empty
401403
[link]
402404
testenv.HasLink()
403405
[mismatched-goroot]

src/cmd/go/testdata/script/gotoolchain_net.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ env GOSUMDB=$oldsumdb
4343
# Test a real GOTOOLCHAIN
4444
[short] skip
4545
[!net:golang.org] skip
46+
[!net:sum.golang.org] skip
4647
[!GOOS:darwin] [!GOOS:windows] [!GOOS:linux] skip
4748
[!GOARCH:amd64] [!GOARCH:arm64] skip
4849

4950
env GOPROXY=
50-
env GOSUMDB=
51+
[go-builder] env GOSUMDB=
52+
[!go-builder] env GOSUMDB=sum.golang.org # Set explicitly in case GOROOT/go.env is modified.
5153
env GOTOOLCHAIN=go1.20.1
5254

5355
# Avoid resolving a "go1.20.1" from the user's real $PATH.

src/cmd/go/testdata/script/gotoolchain_version.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
[!net:golang.org] skip
1+
[!net:proxy.golang.org] skip
22

3-
env GOPROXY=
3+
# In the Go project's official release GOPROXY defaults to proxy.golang.org,
4+
# but it may be changed in GOROOT/go.env (such as in third-party
5+
# distributions).
6+
#
7+
# Make sure it is in use here, because the server for releases not served
8+
# through the proxy (https://golang.org/toolchain?go-get=1) currently only
9+
# serves the latest patch release for each of the supported stable releases.
10+
11+
[go-builder] env GOPROXY=
12+
[!go-builder] env GOPROXY=https://proxy.golang.org
413

514
go list -m -versions go
615
stdout 1.20.1 # among others

src/cmd/go/testdata/script/mod_prefer_compatible.txt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ env GOPROXY=
1010
env GOSUMDB=
1111

1212
# github.com/russross/blackfriday v2.0.0+incompatible exists,
13-
# and should be resolved if we ask for v2.0 explicitly.
13+
# and should be resolved if we ask for it explicitly.
1414

15-
go list -m github.com/russross/[email protected]
15+
go list -m github.com/russross/[email protected].0+incompatible
1616
stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$'
1717

1818
# blackfriday v1.5.2 has a go.mod file, so v1.5.2 should be preferred over
@@ -27,6 +27,7 @@ stdout '^github.com/russross/blackfriday v1\.'
2727
! go list -m github.com/russross/blackfriday@patch
2828
stderr '^go: github.com/russross/blackfriday@patch: can''t query version "patch" of module github.com/russross/blackfriday: no existing version is required$'
2929

30+
3031
# If we're fetching directly from version control, ignored +incompatible
3132
# versions should also be omitted by 'go list'.
3233

@@ -38,10 +39,23 @@ stderr '^go: github.com/russross/blackfriday@patch: can''t query version "patch"
3839
[!git] stop
3940
env GOPROXY=direct
4041

41-
go list -versions -m github.com/russross/blackfriday github.com/russross/blackfriday
42+
go list -versions -m github.com/russross/blackfriday
4243
stdout '^github.com/russross/blackfriday v1\.5\.1 v1\.5\.2' # and possibly others
4344
! stdout ' v2\.'
4445

46+
# For this module, v2.1.0 exists and has a go.mod file.
47+
# 'go list -m github.com/russross/[email protected]' will check
48+
# the latest v2.0 tag, discover that it isn't the right module, and stop there
49+
# (instead of spending the time to check O(N) previous tags).
50+
51+
! go list -m github.com/russross/[email protected]
52+
stderr '^go: module github.com/russross/blackfriday: no matching versions for query "v2\.0\"'
53+
54+
# (But asking for exactly v2.0.0+incompatible should still succeed.)
55+
go list -m github.com/russross/[email protected]+incompatible
56+
stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$'
57+
58+
4559
# However, if the latest compatible version does not include a go.mod file,
4660
# +incompatible versions should still be listed, as they may still reflect the
4761
# intent of the module author.

src/cmd/go/testdata/script/mod_sumdb_file_path.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[!net:proxy.golang.org] skip
2+
[!net:sum.golang.org] skip
23

34
env GO111MODULE=on
4-
env GOSUMDB=
5+
[go-builder] env GOSUMDB=
6+
[!go-builder] env GOSUMDB=sum.golang.org # Set explicitly in case GOROOT/go.env is modified.
57
env GOPATH=$WORK/gopath1
68

79
# With a file-based proxy with an empty checksum directory,

src/cmd/go/testdata/script/mod_sumdb_golang.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Test default GOPROXY and GOSUMDB
2-
env GOPROXY=
3-
env GOSUMDB=
4-
go env GOPROXY
5-
stdout '^https://proxy.golang.org,direct$'
6-
go env GOSUMDB
7-
stdout '^sum.golang.org$'
8-
env GOPROXY=https://proxy.golang.org
9-
go env GOSUMDB
10-
stdout '^sum.golang.org$'
2+
[go-builder] env GOPROXY=
3+
[go-builder] env GOSUMDB=
4+
[go-builder] go env GOPROXY
5+
[go-builder] stdout '^https://proxy.golang.org,direct$'
6+
[go-builder] go env GOSUMDB
7+
[go-builder] stdout '^sum.golang.org$'
8+
[go-builder] env GOPROXY=https://proxy.golang.org
9+
[go-builder] go env GOSUMDB
10+
[go-builder] stdout '^sum.golang.org$'
1111

1212
# Download direct from github.
1313

@@ -26,8 +26,8 @@ cp go.sum saved.sum
2626
# files not listed in go.sum.
2727

2828
go clean -modcache
29-
env GOSUMDB=
30-
env GOPROXY=
29+
env GOSUMDB=sum.golang.org
30+
env GOPROXY=https://proxy.golang.org,direct
3131

3232
go list -x -m all # Download go.mod files.
3333
! stderr github

src/go/types/const.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)