Skip to content

Commit 090372e

Browse files
authored
Merge branch 'golang:master' into master
2 parents b27071c + 3fd729b commit 090372e

File tree

370 files changed

+13939
-15819
lines changed

Some content is hidden

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

370 files changed

+13939
-15819
lines changed

api/next/43936.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pkg testing, method (*B) Attr(string, string) #43936
2+
pkg testing, method (*F) Attr(string, string) #43936
3+
pkg testing, method (*T) Attr(string, string) #43936
4+
pkg testing, type TB interface, Attr(string, string) #43936

api/next/63185.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pkg runtime/trace, func NewFlightRecorder(FlightRecorderConfig) *FlightRecorder #63185
2+
pkg runtime/trace, method (*FlightRecorder) Enabled() bool #63185
3+
pkg runtime/trace, method (*FlightRecorder) Start() error #63185
4+
pkg runtime/trace, method (*FlightRecorder) Stop() #63185
5+
pkg runtime/trace, method (*FlightRecorder) WriteTo(io.Writer) (int64, error) #63185
6+
pkg runtime/trace, type FlightRecorder struct #63185
7+
pkg runtime/trace, type FlightRecorderConfig struct #63185
8+
pkg runtime/trace, type FlightRecorderConfig struct, MaxBytes uint64 #63185
9+
pkg runtime/trace, type FlightRecorderConfig struct, MinAge time.Duration #63185

api/next/63796.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pkg sync, method (*WaitGroup) Go(func()) #63769
1+
pkg sync, method (*WaitGroup) Go(func()) #63796

api/next/63963.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pkg crypto/ecdsa, func ParseRawPrivateKey(elliptic.Curve, []uint8) (*PrivateKey, error) #63963
2+
pkg crypto/ecdsa, func ParseUncompressedPublicKey(elliptic.Curve, []uint8) (*PublicKey, error) #63963
3+
pkg crypto/ecdsa, method (*PrivateKey) Bytes() ([]uint8, error) #63963
4+
pkg crypto/ecdsa, method (*PublicKey) Bytes() ([]uint8, error) #63963

api/next/66365.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pkg log/slog, func GroupAttrs(string, ...Attr) Attr #66365

api/next/67002.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ pkg os, method (*Root) Chown(string, int, int) error #67002
33
pkg os, method (*Root) Chtimes(string, time.Time, time.Time) error #67002
44
pkg os, method (*Root) Lchown(string, int, int) error #67002
55
pkg os, method (*Root) Link(string, string) error #67002
6+
pkg os, method (*Root) MkdirAll(string, fs.FileMode) error #67002
67
pkg os, method (*Root) Readlink(string) (string, error) #67002
8+
pkg os, method (*Root) RemoveAll(string) error #67002
79
pkg os, method (*Root) Rename(string, string) error #67002
810
pkg os, method (*Root) Symlink(string, string) error #67002

api/next/69518.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pkg hash, type XOF interface { BlockSize, Read, Reset, Write } #69518
2+
pkg hash, type XOF interface, BlockSize() int #69518
3+
pkg hash, type XOF interface, Read([]uint8) (int, error) #69518
4+
pkg hash, type XOF interface, Reset() #69518
5+
pkg hash, type XOF interface, Write([]uint8) (int, error) #69518

api/next/69521.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pkg crypto/sha3, method (*SHA3) Clone() (hash.Cloner, error) #69521
2+
pkg hash, type Cloner interface { BlockSize, Clone, Reset, Size, Sum, Write } #69521
3+
pkg hash, type Cloner interface, BlockSize() int #69521
4+
pkg hash, type Cloner interface, Clone() (Cloner, error) #69521
5+
pkg hash, type Cloner interface, Reset() #69521
6+
pkg hash, type Cloner interface, Size() int #69521
7+
pkg hash, type Cloner interface, Sum([]uint8) []uint8 #69521
8+
pkg hash, type Cloner interface, Write([]uint8) (int, error) #69521
9+
pkg hash/maphash, method (*Hash) Clone() (hash.Cloner, error) #69521

api/next/71920.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pkg crypto/tls, type Config struct, GetEncryptedClientHelloKeys func(*ClientHelloInfo) ([]EncryptedClientHelloKey, error) #71920

api/next/73126.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pkg os, method (*Root) ReadFile(string) ([]uint8, error) #73126
2+
pkg os, method (*Root) WriteFile(string, []uint8, fs.FileMode) error #73126

api/next/73193.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pkg runtime, func SetDefaultGOMAXPROCS() #73193

api/next/73626.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pkg net/http, func NewCrossOriginProtection() *CrossOriginProtection #73626
2+
pkg net/http, method (*CrossOriginProtection) AddInsecureBypassPattern(string) #73626
3+
pkg net/http, method (*CrossOriginProtection) AddTrustedOrigin(string) error #73626
4+
pkg net/http, method (*CrossOriginProtection) Check(*Request) error #73626
5+
pkg net/http, method (*CrossOriginProtection) Handler(Handler) Handler #73626
6+
pkg net/http, method (*CrossOriginProtection) SetDenyHandler(Handler) #73626
7+
pkg net/http, type CrossOriginProtection struct #73626

doc/godebug.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,23 @@ Go command will follow symlinks to regular files embedding files.
169169
The default value `embedfollowsymlinks=0` does not allow following
170170
symlinks. `embedfollowsymlinks=1` will allow following symlinks.
171171

172+
Go 1.25 added a new `containermaxprocs` setting that controls whether the Go
173+
runtime will consider cgroup CPU limits when setting the default GOMAXPROCS.
174+
The default value `containermaxprocs=1` will use cgroup limits in addition to
175+
the total logical CPU count and CPU affinity. `containermaxprocs=0` will
176+
disable consideration of cgroup limits. This setting only affects Linux.
177+
178+
Go 1.25 added a new `updatemaxprocs` setting that controls whether the Go
179+
runtime will periodically update GOMAXPROCS for new CPU affinity or cgroup
180+
limits. The default value `updatemaxprocs=1` will enable periodic updates.
181+
`updatemaxprocs=0` will disable periodic updates.
182+
183+
Go 1.25 disabled SHA-1 signature algorithms in TLS 1.2 according to RFC 9155.
184+
The default can be reverted using the `tlssha1=1` setting.
185+
186+
Go 1.25 switched to SHA-256 to fill in missing SubjectKeyId in
187+
crypto/x509.CreateCertificate. The setting `x509sha256skid=0` reverts to SHA-1.
188+
172189
Go 1.25 corrected the semantics of contention reports for runtime-internal locks,
173190
and so removed the [`runtimecontentionstacks` setting](/pkg/runtime#hdr-Environment_Variable).
174191

doc/next/4-runtime.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,31 @@ This program will now print:
1717

1818
panic: PANIC [recovered, repanicked]
1919

20+
<!-- go.dev/issue/73193 -->
21+
22+
The default behavior of the `GOMAXPROCS` has changed. In prior versions of Go,
23+
`GOMAXPROCS` defaults to the number of logical CPUs available at startup
24+
([runtime.NumCPU]). Go 1.25 introduces two changes:
25+
26+
1. On Linux, the runtime considers the CPU bandwidth limit of the cgroup
27+
containing the process, if any. If the CPU bandwidth limit is lower than the
28+
number of logical CPUs available, `GOMAXPROCS` will default to the lower
29+
limit. In container runtime systems like Kubernetes, cgroup CPU bandwidth
30+
limits generally correspond to the "CPU limit" option. The Go runtime does
31+
not consider the "CPU requests" option.
32+
33+
2. On all OSes, the runtime periodically updates `GOMAXPROCS` if the number
34+
of logical CPUs available or the cgroup CPU bandwidth limit change.
35+
36+
Both of these behaviors are automatically disabled if `GOMAXPROCS` is set
37+
manually via the `GOMAXPROCS` environment variable or a call to
38+
[runtime.GOMAXPROCS]. They can also be disabled explicitly with the [GODEBUG
39+
settings](/doc/godebug) `containermaxprocs=0` and `updatemaxprocs=0`,
40+
respectively.
41+
42+
In order to support reading updated cgroup limits, the runtime will keep cached
43+
file descriptors for the cgroup files for the duration of the process lifetime.
44+
2045
<!-- go.dev/issue/71546 -->
2146

2247
On Linux systems with kernel support for anonymous VMA names

doc/next/5-toolchain.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ successfully in Go 1.25. If this change is affecting your code, the solution is
3838
the non-nil error check earlier in your code, preferably immediately after
3939
the error-generating statement.
4040

41+
<!-- CLs 653856, 657937, 663795, 664299 -->
42+
43+
The compiler can now allocate the backing store for slices on the
44+
stack in more situations, which improves performance. This change has
45+
the potential to amplify the effects of incorrect
46+
[unsafe.Pointer](/pkg/unsafe#Pointer) usage, see for example [issue
47+
73199](/issue/73199). In order to track down these problems, the
48+
[bisect tool](https://pkg.go.dev/golang.org/x/tools/cmd/bisect) can be
49+
used to find the allocation causing trouble using the
50+
`-compile=variablemake` flag. All such new stack allocations can also
51+
be turned off using `-gcflags=all=-d=variablemakehash=n`.
52+
4153
## Assembler {#assembler}
4254

4355
## Linker {#linker}

doc/next/6-stdlib/1-synctest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### New testing/synctest package
22

3+
<!-- go.dev/issue/67434, go.dev/issue/73567 -->
34
The new [testing/synctest](/pkg/testing/synctest) package
45
provides support for testing concurrent code.
56

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The new [ParseRawPrivateKey], [ParseUncompressedPublicKey], [PrivateKey.Bytes],
2+
and [PublicKey.Bytes] functions and methods implement low-level encodings,
3+
replacing the need to use crypto/elliptic or math/big functions and methods.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The new [SHA3.Clone] method implements [hash.Cloner](/pkg/hash#Cloner).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The new [Config.GetEncryptedClientHelloKeys] callback can be used to set the
2+
[EncryptedClientHelloKey]s for a server to use when a client sends an Encrypted
3+
Client Hello extension.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SHA-1 signature algorithms are now disallowed in TLS 1.2 handshakes, per
2+
[RFC 9155](https://www.rfc-editor.org/rfc/rfc9155.html).
3+
They can be re-enabled with the `tlssha1=1` GODEBUG option.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TLS servers now prefer the highest supported protocol version, even if it isn't the client's most preferred protocol version.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[CreateCertificate] now uses truncated SHA-256 to populate the `SubjectKeyId` if
2+
it is missing. The GODEBUG setting `x509sha256skid=0` reverts to SHA-1.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The new [XOF](/pkg/hash#XOF) interface can be implemented by "extendable output
2+
functions", which are hash functions with arbitrary or unlimited output length
3+
such as [SHAKE](https://pkg.go.dev/crypto/sha3#SHAKE).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Hashes implementing the new [Cloner] interface can return a copy of their state.
2+
All standard library [Hash] implementations now implement [Cloner].
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The new [Hash.Clone] method implements [hash.Cloner](/pkg/hash#Cloner).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[GroupAttrs] creates a group [Attr] from a slice of [Attr] values.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The new [CrossOriginProtection] implements protections against [Cross-Site
2+
Request Forgery (CSRF)][] by rejecting non-safe cross-origin browser requests.
3+
It uses [modern browser Fetch metadata][Sec-Fetch-Site], doesn't require tokens
4+
or cookies, and supports origin-based and pattern-based bypasses.
5+
6+
[Sec-Fetch-Site]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Site
7+
[Cross-Site Request Forgery (CSRF)]: https://developer.mozilla.org/en-US/docs/Web/Security/Attacks/CSRF

doc/next/6-stdlib/99-minor/os/67002.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The [os.Root] type supports the following additional methods:
55
* [os.Root.Chtimes]
66
* [os.Root.Lchown]
77
* [os.Root.Link]
8+
* [os.Root.MkdirAll]
9+
* [os.Root.ReadFile]
810
* [os.Root.Readlink]
11+
* [os.Root.RemoveAll]
912
* [os.Root.Rename]
1013
* [os.Root.Symlink]
14+
* [os.Root.WriteFile]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- go.dev/issue/73126 is documented as part of 67002 -->
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The new [SetDefaultGOMAXPROCS] function sets `GOMAXPROCS` to the runtime
2+
default value, as if the `GOMAXPROCS` environment variable is not set. This is
3+
useful for enabling the [new `GOMAXPROCS` default](#runtime) if it has been
4+
disabled by the `GOMAXPROCS` environment variable or a prior call to
5+
[GOMAXPROCS].
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!-- go.dev/issue/63185 -->
2+
TODO The flight recorder has been added to the runtime/trace package.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The new methods [T.Attr], [B.Attr], and [F.Attr] emit an
2+
attribute to the test log. An attribute is an arbitrary
3+
key and value associated with a test.
4+
5+
For example, in a test named `TestAttr`,
6+
`t.Attr("key", "value")` emits:
7+
8+
```
9+
=== ATTR TestAttr key value
10+
```

0 commit comments

Comments
 (0)