You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _content/doc/go1.25.md
+40-40Lines changed: 40 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,11 +232,11 @@ release.
232
232
### New testing/synctest package
233
233
234
234
<!-- go.dev/issue/67434, go.dev/issue/73567 -->
235
-
The new [testing/synctest](/pkg/testing/synctest) package
235
+
The new [`testing/synctest`](/pkg/testing/synctest) package
236
236
provides support for testing concurrent code.
237
237
238
238
The [`synctest.Test`](/pkg/testing/synctest#Test) function runs a test function in an isolated
239
-
"bubble". Within the bubble, [time](/pkg/time) package functions
239
+
"bubble". Within the bubble, [`time`](/pkg/time) package functions
240
240
operate on a fake clock.
241
241
242
242
The [`synctest.Wait`](/pkg/testing/synctest#Wait) function waits for all goroutines in the
@@ -246,18 +246,18 @@ current bubble to block.
246
246
247
247
#### [`archive/tar`](/pkg/archive/tar/)
248
248
249
-
The [`*Writer.AddFS`](/pkg/archive/tar#Writer.AddFS) implementation now supports symbolic links
249
+
The [`Writer.AddFS`](/pkg/archive/tar#Writer.AddFS) implementation now supports symbolic links
250
250
for filesystems that implement [`io/fs.ReadLinkFS`](/pkg/io/fs#ReadLinkFS).
251
251
252
252
#### [`crypto`](/pkg/crypto/)
253
253
254
-
[`MessageSigner`](/pkg/crypto#MessageSigner) is a new signing interface that can be implemented by signers that wish to hash the message to be signed themselves. A new function is also introduced, [`SignMessage`](/pkg/crypto#SignMessage) which attempts to update a [`Signer`](/pkg/crypto#Signer) interface to [`MessageSigner`](/pkg/crypto#MessageSigner), using the [`MessageSigner.SignMessage`](/pkg/crypto#MessageSigner.SignMessage) method if successful, and [`Signer.Sign`](/pkg/crypto#Signer.Sign) if not. This can be used when code wishes to support both [`Signer`](/pkg/crypto#Signer) and [`MessageSigner`](/pkg/crypto#MessageSigner).
254
+
[`MessageSigner`](/pkg/crypto#MessageSigner) is a new signing interface that can be implemented by signers that wish to hash the message to be signed themselves. A new function is also introduced, [`SignMessage`](/pkg/crypto#SignMessage), which attempts to update a [`Signer`](/pkg/crypto#Signer) interface to [`MessageSigner`](/pkg/crypto#MessageSigner), using the [`MessageSigner.SignMessage`](/pkg/crypto#MessageSigner.SignMessage) method if successful, and [`Signer.Sign`](/pkg/crypto#Signer.Sign) if not. This can be used when code wishes to support both [`Signer`](/pkg/crypto#Signer) and [`MessageSigner`](/pkg/crypto#MessageSigner).
255
255
256
256
#### [`crypto/ecdsa`](/pkg/crypto/ecdsa/)
257
257
258
258
The new [`ParseRawPrivateKey`](/pkg/crypto/ecdsa#ParseRawPrivateKey), [`ParseUncompressedPublicKey`](/pkg/crypto/ecdsa#ParseUncompressedPublicKey), [`PrivateKey.Bytes`](/pkg/crypto/ecdsa#PrivateKey.Bytes),
259
259
and [`PublicKey.Bytes`](/pkg/crypto/ecdsa#PublicKey.Bytes) functions and methods implement low-level encodings,
260
-
replacing the need to use crypto/elliptic or math/big functions and methods.
260
+
replacing the need to use [`crypto/elliptic`](/pkg/crypto/elliptic) or [`math/big`](/pkg/math/big) functions and methods.
261
261
262
262
#### [`crypto/elliptic`](/pkg/crypto/elliptic/)
263
263
@@ -266,20 +266,20 @@ implementations have been removed.
266
266
267
267
#### [`crypto/sha3`](/pkg/crypto/sha3/)
268
268
269
-
The new [`SHA3.Clone`](/pkg/crypto/sha3#SHA3.Clone) method implements [hash.Cloner](/pkg/hash#Cloner).
269
+
The new [`SHA3.Clone`](/pkg/crypto/sha3#SHA3.Clone) method implements [`hash.Cloner`](/pkg/hash#Cloner).
270
270
271
271
#### [`crypto/tls`](/pkg/crypto/tls/)
272
272
273
273
The new [`ConnectionState.CurveID`](/pkg/crypto/tls#ConnectionState.CurveID) field exposes the key exchange mechanism used
274
274
to establish the connection.
275
275
276
276
The new [`Config.GetEncryptedClientHelloKeys`](/pkg/crypto/tls#Config.GetEncryptedClientHelloKeys) callback can be used to set the
277
-
[EncryptedClientHelloKey]s for a server to use when a client sends an Encrypted
277
+
[`EncryptedClientHelloKey`](/pkg/crypto/tls#EncryptedClientHelloKey)s for a server to use when a client sends an Encrypted
278
278
Client Hello extension.
279
279
280
280
SHA-1 signature algorithms are now disallowed in TLS 1.2 handshakes, per
They can be re-enabled with the `tlssha1=1` GODEBUG option.
282
+
They can be re-enabled with the `tlssha1=1`[GODEBUG option](/doc/godebug).
283
283
284
284
When [FIPS 140-3 mode](/doc/security/fips140) is enabled, Extended Master Secret
285
285
is now required in TLS 1.2, and Ed25519 and X25519MLKEM768 are now allowed.
@@ -291,7 +291,7 @@ TLS servers now prefer the highest supported protocol version, even if it isn't
291
291
[`CreateCertificate`](/pkg/crypto/x509#CreateCertificate), [`CreateCertificateRequest`](/pkg/crypto/x509#CreateCertificateRequest), and [`CreateRevocationList`](/pkg/crypto/x509#CreateRevocationList) can now accept a [`crypto.MessageSigner`](/pkg/crypto#MessageSigner) signing interface as well as [`crypto.Signer`](/pkg/crypto#Signer). This allows these functions to use signers which implement "one-shot" signing interfaces, where hashing is done as part of the signing operation, instead of by the caller.
292
292
293
293
[`CreateCertificate`](/pkg/crypto/x509#CreateCertificate) now uses truncated SHA-256 to populate the `SubjectKeyId` if
294
-
it is missing. The GODEBUG setting `x509sha256skid=0` reverts to SHA-1.
294
+
it is missing. The [GODEBUG setting](/doc/godebug)`x509sha256skid=0` reverts to SHA-1.
295
295
296
296
#### [`debug/elf`](/pkg/debug/elf/)
297
297
@@ -302,10 +302,10 @@ The [`debug/elf`](/pkg/debug/elf) package adds two new constants:
302
302
303
303
#### [`go/ast`](/pkg/go/ast/)
304
304
305
-
The [`ast.FilterPackage`](/pkg/ast#FilterPackage), [`ast.PackageExports`](/pkg/ast#PackageExports), and
306
-
[`ast.MergePackageFiles`](/pkg/ast#MergePackageFiles) functions, and the [`MergeMode`](/pkg/go/ast#MergeMode) type and its
305
+
The [`FilterPackage`](/pkg/ast#FilterPackage), [`PackageExports`](/pkg/ast#PackageExports), and
306
+
[`MergePackageFiles`](/pkg/ast#MergePackageFiles) functions, and the [`MergeMode`](/pkg/go/ast#MergeMode) type and its
307
307
constants, are all deprecated, as they are for use only with the
308
-
long-deprecated [`ast.Object`](/pkg/ast#Object) and [`ast.Package`](/pkg/ast#Package) machinery.
308
+
long-deprecated [`Object`](/pkg/ast#Object) and [`Package`](/pkg/ast#Package) machinery.
309
309
310
310
The new [`PreorderStack`](/pkg/go/ast#PreorderStack) function, like [`Inspect`](/pkg/go/ast#Inspect), traverses a syntax
311
311
tree and provides control over descent into subtrees, but as a
@@ -318,10 +318,11 @@ The [`ParseDir`](/pkg/go/parser#ParseDir) function is deprecated.
318
318
319
319
#### [`go/token`](/pkg/go/token/)
320
320
321
-
The new [`FileSet.AddExistingFiles`](/pkg/go/token#FileSet.AddExistingFiles) method enables existing Files to be
322
-
added to a FileSet, or a FileSet to be constructed for an arbitrary
323
-
set of Files, alleviating the problems associated with a single global
324
-
FileSet in long-lived applications.
321
+
The new [`FileSet.AddExistingFiles`](/pkg/go/token#FileSet.AddExistingFiles) method enables existing
322
+
[`File`](/pkg/go/token#File)s to be added to a [`FileSet`](/pkg/go/token#FileSet),
323
+
or a [`FileSet`](/pkg/go/token#FileSet) to be constructed for an arbitrary
324
+
set of [`File`](/pkg/go/token#File)s, alleviating the problems associated with a single global
325
+
[`FileSet`](/pkg/go/token#FileSet) in long-lived applications.
325
326
326
327
#### [`go/types`](/pkg/go/types/)
327
328
@@ -335,9 +336,9 @@ function, but returns the result in the form of a [`Selection`](/pkg/go/types#Se
335
336
336
337
#### [`hash`](/pkg/hash/)
337
338
338
-
The new [XOF](/pkg/hash#XOF) interface can be implemented by "extendable output
339
+
The new [`XOF`](/pkg/hash#XOF) interface can be implemented by "extendable output
339
340
functions", which are hash functions with arbitrary or unlimited output length
340
-
such as [SHAKE](https://pkg.go.dev/crypto/sha3#SHAKE).
341
+
such as [SHAKE](/pkg/crypto/sha3#SHAKE).
341
342
342
343
Hashes implementing the new [`Cloner`](/pkg/hash#Cloner) interface can return a copy of their state.
343
344
All standard library [`Hash`](/pkg/hash#Hash) implementations now implement [`Cloner`](/pkg/hash#Cloner).
@@ -354,7 +355,8 @@ A new [`ReadLinkFS`](/pkg/io/fs#ReadLinkFS) interface provides the ability to re
354
355
355
356
[`GroupAttrs`](/pkg/log/slog#GroupAttrs) creates a group [`Attr`](/pkg/log/slog#Attr) from a slice of [`Attr`](/pkg/log/slog#Attr) values.
356
357
357
-
[`Record`](/pkg/log/slog#Record) now has a Source() method, returning its source location or nil if unavailable.
358
+
[`Record`](/pkg/log/slog#Record) now has a [`Source`](/pkg/log/slog#Record.Source) method,
359
+
returning its source location or nil if unavailable.
358
360
359
361
#### [`mime/multipart`](/pkg/mime/multipart/)
360
362
@@ -367,10 +369,10 @@ On Windows, the [`TCPConn.File`](/pkg/net#TCPConn.File), [`UDPConn.File`](/pkg/n
367
369
[`IPConn.File`](/pkg/net#IPConn.File), [`TCPListener.File`](/pkg/net#TCPListener.File), and [`UnixListener.File`](/pkg/net#UnixListener.File)
368
370
methods are now supported.
369
371
370
-
[`LookupMX`](/pkg/net#LookupMX) and [`*Resolver.LookupMX`](/pkg/net#Resolver.LookupMX) now return DNS names that look
372
+
[`LookupMX`](/pkg/net#LookupMX) and [`Resolver.LookupMX`](/pkg/net#Resolver.LookupMX) now return DNS names that look
371
373
like valid IP address, as well as valid domain names.
372
374
Previously if a name server returned an IP address as a DNS name,
373
-
LookupMX would discard it, as required by the RFCs.
375
+
[`LookupMX`](/pkg/net#LookupMX) would discard it, as required by the RFCs.
374
376
However, name servers in practice do sometimes return IP addresses.
375
377
376
378
On Windows, the [`ListenMulticastUDP`](/pkg/net#ListenMulticastUDP) now supports IPv6 addresses.
@@ -402,23 +404,23 @@ If the handle provided to [`NewFile`](/pkg/os#NewFile) is already associated wit
402
404
the returned [`File`](/pkg/os#File) is downgraded to synchronous I/O mode.
403
405
In this case, I/O methods will block an OS thread, and the deadline methods have no effect.
404
406
405
-
The filesystems returned by [`DirFS`](/pkg/os#DirFS) and [`*Root.FS`](/pkg/os#Root.FS) implement the new [`io/fs.ReadLinkFS`](/pkg/io/fs#ReadLinkFS) interface.
407
+
The filesystems returned by [`DirFS`](/pkg/os#DirFS) and [`Root.FS`](/pkg/os#Root.FS) implement the new [`io/fs.ReadLinkFS`](/pkg/io/fs#ReadLinkFS) interface.
406
408
[`CopyFS`](/pkg/os#CopyFS) supports symlinks when copying filesystems that implement [`io/fs.ReadLinkFS`](/pkg/io/fs#ReadLinkFS).
407
409
408
-
The [`os.Root`](/pkg/os#Root) type supports the following additional methods:
409
-
410
-
*[`os.Root.Chmod`](/pkg/os#Root.Chmod)
411
-
*[`os.Root.Chown`](/pkg/os#Root.Chown)
412
-
*[`os.Root.Chtimes`](/pkg/os#Root.Chtimes)
413
-
*[`os.Root.Lchown`](/pkg/os#Root.Lchown)
414
-
*[`os.Root.Link`](/pkg/os#Root.Link)
415
-
*[`os.Root.MkdirAll`](/pkg/os#Root.MkdirAll)
416
-
*[`os.Root.ReadFile`](/pkg/os#Root.ReadFile)
417
-
*[`os.Root.Readlink`](/pkg/os#Root.Readlink)
418
-
*[`os.Root.RemoveAll`](/pkg/os#Root.RemoveAll)
419
-
*[`os.Root.Rename`](/pkg/os#Root.Rename)
420
-
*[`os.Root.Symlink`](/pkg/os#Root.Symlink)
421
-
*[`os.Root.WriteFile`](/pkg/os#Root.WriteFile)
410
+
The [`Root`](/pkg/os#Root) type supports the following additional methods:
411
+
412
+
*[`Root.Chmod`](/pkg/os#Root.Chmod)
413
+
*[`Root.Chown`](/pkg/os#Root.Chown)
414
+
*[`Root.Chtimes`](/pkg/os#Root.Chtimes)
415
+
*[`Root.Lchown`](/pkg/os#Root.Lchown)
416
+
*[`Root.Link`](/pkg/os#Root.Link)
417
+
*[`Root.MkdirAll`](/pkg/os#Root.MkdirAll)
418
+
*[`Root.ReadFile`](/pkg/os#Root.ReadFile)
419
+
*[`Root.Readlink`](/pkg/os#Root.Readlink)
420
+
*[`Root.RemoveAll`](/pkg/os#Root.RemoveAll)
421
+
*[`Root.Rename`](/pkg/os#Root.Rename)
422
+
*[`Root.Symlink`](/pkg/os#Root.Symlink)
423
+
*[`Root.WriteFile`](/pkg/os#Root.WriteFile)
422
424
423
425
<!-- go.dev/issue/73126 is documented as part of 67002 -->
424
426
@@ -514,9 +516,7 @@ The new panicking behavior helps catch such bugs.
514
516
[`TestFS`](/pkg/testing/fstest#TestFS) will verify the functionality of the [`io/fs.ReadLinkFS`](/pkg/io/fs#ReadLinkFS) interface if implemented.
515
517
[`TestFS`](/pkg/testing/fstest#TestFS) will no longer follow symlinks to avoid unbounded recursion.
0 commit comments