_content/doc: change relnote definition lists to headings

Since 1.7, the "Minor changes to the library" second has used
a definition list to describe the changes to each package.

Use level 4 headings instead. This removes one feature
that is not CommonMark-compliant. It paves the way for
using a CommonMark-compliant Markdown parser and renderer
for both display and generation of release notes.

For golang/go#64169.

Change-Id: I2327499971a2db4eee06ef35e3e41cd0d2f953b3
Reviewed-on: https://go-review.googlesource.com/c/website/+/541976
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Jonathan Amsterdam 2023-11-13 11:33:24 -05:00
Родитель 807d4851b0
Коммит 94d899bc85
15 изменённых файлов: 6376 добавлений и 6376 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -408,402 +408,402 @@ in mind.
<!-- CL 110395: https://golang.org/cl/110395: cmd/go, cmd/compile: use Windows response files to avoid arg length limits -->
<!-- CL 112436: https://golang.org/cl/112436: cmd/pprof: add readline support similar to upstream -->
[crypto](/pkg/crypto/)
#### [crypto](/pkg/crypto/)
: <!-- CL 64451 -->
Certain crypto operations, including
[`ecdsa.Sign`](/pkg/crypto/ecdsa/#Sign),
[`rsa.EncryptPKCS1v15`](/pkg/crypto/rsa/#EncryptPKCS1v15) and
[`rsa.GenerateKey`](/pkg/crypto/rsa/#GenerateKey),
now randomly read an extra byte of randomness to ensure tests don't rely on internal behavior.
<!-- CL 64451 -->
Certain crypto operations, including
[`ecdsa.Sign`](/pkg/crypto/ecdsa/#Sign),
[`rsa.EncryptPKCS1v15`](/pkg/crypto/rsa/#EncryptPKCS1v15) and
[`rsa.GenerateKey`](/pkg/crypto/rsa/#GenerateKey),
now randomly read an extra byte of randomness to ensure tests don't rely on internal behavior.
<!-- crypto -->
[crypto/cipher](/pkg/crypto/cipher/)
#### [crypto/cipher](/pkg/crypto/cipher/)
: <!-- CL 48510, CL 116435 -->
The new function [`NewGCMWithTagSize`](/pkg/crypto/cipher/#NewGCMWithTagSize)
implements Galois Counter Mode with non-standard tag lengths for compatibility with existing cryptosystems.
<!-- CL 48510, CL 116435 -->
The new function [`NewGCMWithTagSize`](/pkg/crypto/cipher/#NewGCMWithTagSize)
implements Galois Counter Mode with non-standard tag lengths for compatibility with existing cryptosystems.
<!-- crypto/cipher -->
[crypto/rsa](/pkg/crypto/rsa/)
#### [crypto/rsa](/pkg/crypto/rsa/)
: <!-- CL 103876 -->
[`PublicKey`](/pkg/crypto/rsa/#PublicKey) now implements a
[`Size`](/pkg/crypto/rsa/#PublicKey.Size) method that
returns the modulus size in bytes.
<!-- CL 103876 -->
[`PublicKey`](/pkg/crypto/rsa/#PublicKey) now implements a
[`Size`](/pkg/crypto/rsa/#PublicKey.Size) method that
returns the modulus size in bytes.
<!-- crypto/rsa -->
[crypto/tls](/pkg/crypto/tls/)
#### [crypto/tls](/pkg/crypto/tls/)
: <!-- CL 85115 -->
[`ConnectionState`](/pkg/crypto/tls/#ConnectionState)'s new
[`ExportKeyingMaterial`](/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial)
method allows exporting keying material bound to the
connection according to RFC 5705.
<!-- CL 85115 -->
[`ConnectionState`](/pkg/crypto/tls/#ConnectionState)'s new
[`ExportKeyingMaterial`](/pkg/crypto/tls/#ConnectionState.ExportKeyingMaterial)
method allows exporting keying material bound to the
connection according to RFC 5705.
<!-- crypto/tls -->
[crypto/x509](/pkg/crypto/x509/)
#### [crypto/x509](/pkg/crypto/x509/)
: <!-- CL 123355, CL 123695 -->
The deprecated, legacy behavior of treating the `CommonName` field as
a hostname when no Subject Alternative Names are present is now disabled when the CN is not a
valid hostname.
The `CommonName` can be completely ignored by adding the experimental value
`x509ignoreCN=1` to the `GODEBUG` environment variable.
When the CN is ignored, certificates without SANs validate under chains with name constraints
instead of returning `NameConstraintsWithoutSANs`.
<!-- CL 123355, CL 123695 -->
The deprecated, legacy behavior of treating the `CommonName` field as
a hostname when no Subject Alternative Names are present is now disabled when the CN is not a
valid hostname.
The `CommonName` can be completely ignored by adding the experimental value
`x509ignoreCN=1` to the `GODEBUG` environment variable.
When the CN is ignored, certificates without SANs validate under chains with name constraints
instead of returning `NameConstraintsWithoutSANs`.
<!-- CL 113475 -->
Extended key usage restrictions are again checked only if they appear in the `KeyUsages`
field of [`VerifyOptions`](/pkg/crypto/x509/#VerifyOptions), instead of always being checked.
This matches the behavior of Go 1.9 and earlier.
<!-- CL 113475 -->
Extended key usage restrictions are again checked only if they appear in the `KeyUsages`
field of [`VerifyOptions`](/pkg/crypto/x509/#VerifyOptions), instead of always being checked.
This matches the behavior of Go 1.9 and earlier.
<!-- CL 102699 -->
The value returned by [`SystemCertPool`](/pkg/crypto/x509/#SystemCertPool)
is now cached and might not reflect system changes between invocations.
<!-- CL 102699 -->
The value returned by [`SystemCertPool`](/pkg/crypto/x509/#SystemCertPool)
is now cached and might not reflect system changes between invocations.
<!-- crypto/x509 -->
[debug/elf](/pkg/debug/elf/)
#### [debug/elf](/pkg/debug/elf/)
: <!-- CL 112115 -->
More [`ELFOSABI`](/pkg/debug/elf/#ELFOSABI_NONE)
and [`EM`](/pkg/debug/elf/#EM_NONE)
constants have been added.
<!-- CL 112115 -->
More [`ELFOSABI`](/pkg/debug/elf/#ELFOSABI_NONE)
and [`EM`](/pkg/debug/elf/#EM_NONE)
constants have been added.
<!-- debug/elf -->
[encoding/asn1](/pkg/encoding/asn1/)
#### [encoding/asn1](/pkg/encoding/asn1/)
: <!-- CL 110561 -->
`Marshal` and [`Unmarshal`](/pkg/encoding/asn1/#Unmarshal)
now support "private" class annotations for fields.
<!-- CL 110561 -->
`Marshal` and [`Unmarshal`](/pkg/encoding/asn1/#Unmarshal)
now support "private" class annotations for fields.
<!-- encoding/asn1 -->
[encoding/base32](/pkg/encoding/base32/)
#### [encoding/base32](/pkg/encoding/base32/)
: <!-- CL 112516 -->
The decoder now consistently
returns `io.ErrUnexpectedEOF` for an incomplete
chunk. Previously it would return `io.EOF` in some
cases.
<!-- CL 112516 -->
The decoder now consistently
returns `io.ErrUnexpectedEOF` for an incomplete
chunk. Previously it would return `io.EOF` in some
cases.
<!-- encoding/base32 -->
[encoding/csv](/pkg/encoding/csv/)
#### [encoding/csv](/pkg/encoding/csv/)
: <!-- CL 99696 -->
The `Reader` now rejects attempts to set
the [`Comma`](/pkg/encoding/csv/#Reader.Comma)
field to a double-quote character, as double-quote characters
already have a special meaning in CSV.
<!-- CL 99696 -->
The `Reader` now rejects attempts to set
the [`Comma`](/pkg/encoding/csv/#Reader.Comma)
field to a double-quote character, as double-quote characters
already have a special meaning in CSV.
<!-- encoding/csv -->
<!-- CL 100235 was reverted -->
[html/template](/pkg/html/template/)
#### [html/template](/pkg/html/template/)
: <!-- CL 121815 -->
The package has changed its behavior when a typed interface
value is passed to an implicit escaper function. Previously such
a value was written out as (an escaped form)
of `<nil>`. Now such values are ignored, just
as an untyped `nil` value is (and always has been)
ignored.
<!-- CL 121815 -->
The package has changed its behavior when a typed interface
value is passed to an implicit escaper function. Previously such
a value was written out as (an escaped form)
of `<nil>`. Now such values are ignored, just
as an untyped `nil` value is (and always has been)
ignored.
<!-- html/template -->
[image/gif](/pkg/image/gif/)
#### [image/gif](/pkg/image/gif/)
: <!-- CL 93076 -->
Non-looping animated GIFs are now supported. They are denoted by having a
[`LoopCount`](/pkg/image/gif/#GIF.LoopCount) of -1.
<!-- CL 93076 -->
Non-looping animated GIFs are now supported. They are denoted by having a
[`LoopCount`](/pkg/image/gif/#GIF.LoopCount) of -1.
<!-- image/gif -->
[io/ioutil](/pkg/io/ioutil/)
#### [io/ioutil](/pkg/io/ioutil/)
: <!-- CL 105675 -->
The [`TempFile`](/pkg/io/ioutil/#TempFile)
function now supports specifying where the random characters in
the filename are placed. If the `prefix` argument
includes a "`*`", the random string replaces the
"`*`". For example, a `prefix` argument of "`myname.*.bat`" will
result in a random filename such as
"`myname.123456.bat`". If no "`*`" is
included the old behavior is retained, and the random digits are
appended to the end.
<!-- CL 105675 -->
The [`TempFile`](/pkg/io/ioutil/#TempFile)
function now supports specifying where the random characters in
the filename are placed. If the `prefix` argument
includes a "`*`", the random string replaces the
"`*`". For example, a `prefix` argument of "`myname.*.bat`" will
result in a random filename such as
"`myname.123456.bat`". If no "`*`" is
included the old behavior is retained, and the random digits are
appended to the end.
<!-- io/ioutil -->
[math/big](/pkg/math/big/)
#### [math/big](/pkg/math/big/)
: <!-- CL 108996 -->
[`ModInverse`](/pkg/math/big/#Int.ModInverse) now returns nil when g and n are not relatively prime. The result was previously undefined.
<!-- CL 108996 -->
[`ModInverse`](/pkg/math/big/#Int.ModInverse) now returns nil when g and n are not relatively prime. The result was previously undefined.
<!-- math/big -->
[mime/multipart](/pkg/mime/multipart/)
#### [mime/multipart](/pkg/mime/multipart/)
: <!-- CL 121055 -->
The handling of form-data with missing/empty file names has been
restored to the behavior in Go 1.9: in the
[`Form`](/pkg/mime/multipart/#Form) for
the form-data part the value is available in
the `Value` field rather than the `File`
field. In Go releases 1.10 through 1.10.3 a form-data part with
a missing/empty file name and a non-empty "Content-Type" field
was stored in the `File` field. This change was a
mistake in 1.10 and has been reverted to the 1.9 behavior.
<!-- CL 121055 -->
The handling of form-data with missing/empty file names has been
restored to the behavior in Go 1.9: in the
[`Form`](/pkg/mime/multipart/#Form) for
the form-data part the value is available in
the `Value` field rather than the `File`
field. In Go releases 1.10 through 1.10.3 a form-data part with
a missing/empty file name and a non-empty "Content-Type" field
was stored in the `File` field. This change was a
mistake in 1.10 and has been reverted to the 1.9 behavior.
<!-- mime/multipart -->
[mime/quotedprintable](/pkg/mime/quotedprintable/)
#### [mime/quotedprintable](/pkg/mime/quotedprintable/)
: <!-- CL 121095 -->
To support invalid input found in the wild, the package now
permits non-ASCII bytes but does not validate their encoding.
<!-- CL 121095 -->
To support invalid input found in the wild, the package now
permits non-ASCII bytes but does not validate their encoding.
<!-- mime/quotedprintable -->
[net](/pkg/net/)
#### [net](/pkg/net/)
: <!-- CL 72810 -->
The new [`ListenConfig`](/pkg/net/#ListenConfig) type and the new
[`Dialer.Control`](/pkg/net/#Dialer.Control) field permit
setting socket options before accepting and creating connections, respectively.
<!-- CL 72810 -->
The new [`ListenConfig`](/pkg/net/#ListenConfig) type and the new
[`Dialer.Control`](/pkg/net/#Dialer.Control) field permit
setting socket options before accepting and creating connections, respectively.
<!-- CL 76391 -->
The [`syscall.RawConn`](/pkg/syscall/#RawConn) `Read`
and `Write` methods now work correctly on Windows.
<!-- CL 76391 -->
The [`syscall.RawConn`](/pkg/syscall/#RawConn) `Read`
and `Write` methods now work correctly on Windows.
<!-- CL 107715 -->
The `net` package now automatically uses the
[`splice` system call](https://man7.org/linux/man-pages/man2/splice.2.html)
on Linux when copying data between TCP connections in
[`TCPConn.ReadFrom`](/pkg/net/#TCPConn.ReadFrom), as called by
[`io.Copy`](/pkg/io/#Copy). The result is faster, more efficient TCP proxying.
<!-- CL 107715 -->
The `net` package now automatically uses the
[`splice` system call](https://man7.org/linux/man-pages/man2/splice.2.html)
on Linux when copying data between TCP connections in
[`TCPConn.ReadFrom`](/pkg/net/#TCPConn.ReadFrom), as called by
[`io.Copy`](/pkg/io/#Copy). The result is faster, more efficient TCP proxying.
<!-- CL 108297 -->
The [`TCPConn.File`](/pkg/net/#TCPConn.File),
[`UDPConn.File`](/pkg/net/#UDPConn.File),
[`UnixConn.File`](/pkg/net/#UnixCOnn.File),
and [`IPConn.File`](/pkg/net/#IPConn.File)
methods no longer put the returned `*os.File` into
blocking mode.
<!-- CL 108297 -->
The [`TCPConn.File`](/pkg/net/#TCPConn.File),
[`UDPConn.File`](/pkg/net/#UDPConn.File),
[`UnixConn.File`](/pkg/net/#UnixCOnn.File),
and [`IPConn.File`](/pkg/net/#IPConn.File)
methods no longer put the returned `*os.File` into
blocking mode.
<!-- net -->
[net/http](/pkg/net/http/)
#### [net/http](/pkg/net/http/)
: <!-- CL 71272 -->
The [`Transport`](/pkg/net/http/#Transport) type has a
new [`MaxConnsPerHost`](/pkg/net/http/#Transport.MaxConnsPerHost)
option that permits limiting the maximum number of connections
per host.
<!-- CL 71272 -->
The [`Transport`](/pkg/net/http/#Transport) type has a
new [`MaxConnsPerHost`](/pkg/net/http/#Transport.MaxConnsPerHost)
option that permits limiting the maximum number of connections
per host.
<!-- CL 79919 -->
The [`Cookie`](/pkg/net/http/#Cookie) type has a new
[`SameSite`](/pkg/net/http/#Cookie.SameSite) field
(of new type also named
[`SameSite`](/pkg/net/http/#SameSite)) to represent the new cookie attribute recently supported by most browsers.
The `net/http`'s `Transport` does not use the `SameSite`
attribute itself, but the package supports parsing and serializing the
attribute for browsers to use.
<!-- CL 79919 -->
The [`Cookie`](/pkg/net/http/#Cookie) type has a new
[`SameSite`](/pkg/net/http/#Cookie.SameSite) field
(of new type also named
[`SameSite`](/pkg/net/http/#SameSite)) to represent the new cookie attribute recently supported by most browsers.
The `net/http`'s `Transport` does not use the `SameSite`
attribute itself, but the package supports parsing and serializing the
attribute for browsers to use.
<!-- CL 81778 -->
It is no longer allowed to reuse a [`Server`](/pkg/net/http/#Server)
after a call to
[`Shutdown`](/pkg/net/http/#Server.Shutdown) or
[`Close`](/pkg/net/http/#Server.Close). It was never officially supported
in the past and had often surprising behavior. Now, all future calls to the server's `Serve`
methods will return errors after a shutdown or close.
<!-- CL 81778 -->
It is no longer allowed to reuse a [`Server`](/pkg/net/http/#Server)
after a call to
[`Shutdown`](/pkg/net/http/#Server.Shutdown) or
[`Close`](/pkg/net/http/#Server.Close). It was never officially supported
in the past and had often surprising behavior. Now, all future calls to the server's `Serve`
methods will return errors after a shutdown or close.
<!-- CL 89275 was reverted before Go 1.11 -->
<!-- CL 89275 was reverted before Go 1.11 -->
<!-- CL 93296 -->
The constant `StatusMisdirectedRequest` is now defined for HTTP status code 421.
<!-- CL 93296 -->
The constant `StatusMisdirectedRequest` is now defined for HTTP status code 421.
<!-- CL 123875 -->
The HTTP server will no longer cancel contexts or send on
[`CloseNotifier`](/pkg/net/http/#CloseNotifier)
channels upon receiving pipelined HTTP/1.1 requests. Browsers do
not use HTTP pipelining, but some clients (such as
Debian's `apt`) may be configured to do so.
<!-- CL 123875 -->
The HTTP server will no longer cancel contexts or send on
[`CloseNotifier`](/pkg/net/http/#CloseNotifier)
channels upon receiving pipelined HTTP/1.1 requests. Browsers do
not use HTTP pipelining, but some clients (such as
Debian's `apt`) may be configured to do so.
<!-- CL 115255 -->
[`ProxyFromEnvironment`](/pkg/net/http/#ProxyFromEnvironment), which is used by the
[`DefaultTransport`](/pkg/net/http/#DefaultTransport), now
supports CIDR notation and ports in the `NO_PROXY` environment variable.
<!-- CL 115255 -->
[`ProxyFromEnvironment`](/pkg/net/http/#ProxyFromEnvironment), which is used by the
[`DefaultTransport`](/pkg/net/http/#DefaultTransport), now
supports CIDR notation and ports in the `NO_PROXY` environment variable.
<!-- net/http -->
[net/http/httputil](/pkg/net/http/httputil/)
#### [net/http/httputil](/pkg/net/http/httputil/)
: <!-- CL 77410 -->
The
[`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
has a new
[`ErrorHandler`](/pkg/net/http/httputil/#ReverseProxy.ErrorHandler)
option to permit changing how errors are handled.
<!-- CL 77410 -->
The
[`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
has a new
[`ErrorHandler`](/pkg/net/http/httputil/#ReverseProxy.ErrorHandler)
option to permit changing how errors are handled.
<!-- CL 115135 -->
The `ReverseProxy` now also passes
"`TE:`&nbsp;`trailers`" request headers
through to the backend, as required by the gRPC protocol.
<!-- CL 115135 -->
The `ReverseProxy` now also passes
"`TE:`&nbsp;`trailers`" request headers
through to the backend, as required by the gRPC protocol.
<!-- net/http/httputil -->
[os](/pkg/os/)
#### [os](/pkg/os/)
: <!-- CL 78835 -->
The new [`UserCacheDir`](/pkg/os/#UserCacheDir) function
returns the default root directory to use for user-specific cached data.
<!-- CL 78835 -->
The new [`UserCacheDir`](/pkg/os/#UserCacheDir) function
returns the default root directory to use for user-specific cached data.
<!-- CL 94856 -->
The new [`ModeIrregular`](/pkg/os/#ModeIrregular)
is a [`FileMode`](/pkg/os/#FileMode) bit to represent
that a file is not a regular file, but nothing else is known about it, or that
it's not a socket, device, named pipe, symlink, or other file type for which
Go has a defined mode bit.
<!-- CL 94856 -->
The new [`ModeIrregular`](/pkg/os/#ModeIrregular)
is a [`FileMode`](/pkg/os/#FileMode) bit to represent
that a file is not a regular file, but nothing else is known about it, or that
it's not a socket, device, named pipe, symlink, or other file type for which
Go has a defined mode bit.
<!-- CL 99337 -->
[`Symlink`](/pkg/os/#Symlink) now works
for unprivileged users on Windows 10 on machines with Developer
Mode enabled.
<!-- CL 99337 -->
[`Symlink`](/pkg/os/#Symlink) now works
for unprivileged users on Windows 10 on machines with Developer
Mode enabled.
<!-- CL 100077 -->
When a non-blocking descriptor is passed
to [`NewFile`](/pkg/os#NewFile), the
resulting `*File` will be kept in non-blocking
mode. This means that I/O for that `*File` will use
the runtime poller rather than a separate thread, and that
the [`SetDeadline`](/pkg/os/#File.SetDeadline)
methods will work.
<!-- CL 100077 -->
When a non-blocking descriptor is passed
to [`NewFile`](/pkg/os#NewFile), the
resulting `*File` will be kept in non-blocking
mode. This means that I/O for that `*File` will use
the runtime poller rather than a separate thread, and that
the [`SetDeadline`](/pkg/os/#File.SetDeadline)
methods will work.
<!-- os -->
[os/signal](/pkg/os/signal/)
#### [os/signal](/pkg/os/signal/)
: <!-- CL 108376 -->
The new [`Ignored`](/pkg/os/signal/#Ignored) function reports
whether a signal is currently ignored.
<!-- CL 108376 -->
The new [`Ignored`](/pkg/os/signal/#Ignored) function reports
whether a signal is currently ignored.
<!-- os/signal -->
[os/user](/pkg/os/user/)
#### [os/user](/pkg/os/user/)
: <!-- CL 92456 -->
The `os/user` package can now be built in pure Go
mode using the build tag "`osusergo`",
independent of the use of the environment
variable `CGO_ENABLED=0`. Previously the only way to use
the package's pure Go implementation was to disable `cgo`
support across the entire program.
<!-- CL 92456 -->
The `os/user` package can now be built in pure Go
mode using the build tag "`osusergo`",
independent of the use of the environment
variable `CGO_ENABLED=0`. Previously the only way to use
the package's pure Go implementation was to disable `cgo`
support across the entire program.
<!-- os/user -->
<!-- CL 101715 was reverted -->
[runtime](/pkg/runtime/)
#### [runtime](/pkg/runtime/)
: <!-- CL 70993 -->
Setting the <code>GODEBUG=tracebackancestors=_N_</code>
environment variable now extends tracebacks with the stacks at
which goroutines were created, where _N_ limits the
number of ancestor goroutines to report.
<!-- CL 70993 -->
Setting the <code>GODEBUG=tracebackancestors=_N_</code>
environment variable now extends tracebacks with the stacks at
which goroutines were created, where _N_ limits the
number of ancestor goroutines to report.
<!-- runtime -->
[runtime/pprof](/pkg/runtime/pprof/)
#### [runtime/pprof](/pkg/runtime/pprof/)
: <!-- CL 102696 -->
This release adds a new "allocs" profile type that profiles
total number of bytes allocated since the program began
(including garbage-collected bytes). This is identical to the
existing "heap" profile viewed in `-alloc_space` mode.
Now `go test -memprofile=...` reports an "allocs" profile
instead of "heap" profile.
<!-- CL 102696 -->
This release adds a new "allocs" profile type that profiles
total number of bytes allocated since the program began
(including garbage-collected bytes). This is identical to the
existing "heap" profile viewed in `-alloc_space` mode.
Now `go test -memprofile=...` reports an "allocs" profile
instead of "heap" profile.
<!-- runtime/pprof -->
[sync](/pkg/sync/)
#### [sync](/pkg/sync/)
: <!-- CL 87095 -->
The mutex profile now includes reader/writer contention
for [`RWMutex`](/pkg/sync/#RWMutex).
Writer/writer contention was already included in the mutex
profile.
<!-- CL 87095 -->
The mutex profile now includes reader/writer contention
for [`RWMutex`](/pkg/sync/#RWMutex).
Writer/writer contention was already included in the mutex
profile.
<!-- sync -->
[syscall](/pkg/syscall/)
#### [syscall](/pkg/syscall/)
: <!-- CL 106275 -->
On Windows, several fields were changed from `uintptr` to a new
[`Pointer`](/pkg/syscall/?GOOS=windows&GOARCH=amd64#Pointer)
type to avoid problems with Go's garbage collector. The same change was made
to the [`golang.org/x/sys/windows`](https://godoc.org/golang.org/x/sys/windows)
package. For any code affected, users should first migrate away from the `syscall`
package to the `golang.org/x/sys/windows` package, and then change
to using the `Pointer`, while obeying the
[`unsafe.Pointer` conversion rules](/pkg/unsafe/#Pointer).
<!-- CL 106275 -->
On Windows, several fields were changed from `uintptr` to a new
[`Pointer`](/pkg/syscall/?GOOS=windows&GOARCH=amd64#Pointer)
type to avoid problems with Go's garbage collector. The same change was made
to the [`golang.org/x/sys/windows`](https://godoc.org/golang.org/x/sys/windows)
package. For any code affected, users should first migrate away from the `syscall`
package to the `golang.org/x/sys/windows` package, and then change
to using the `Pointer`, while obeying the
[`unsafe.Pointer` conversion rules](/pkg/unsafe/#Pointer).
<!-- CL 118658 -->
On Linux, the `flags` parameter to
[`Faccessat`](/pkg/syscall/?GOOS=linux&GOARCH=amd64#Faccessat)
is now implemented just as in glibc. In earlier Go releases the
flags parameter was ignored.
<!-- CL 118658 -->
On Linux, the `flags` parameter to
[`Faccessat`](/pkg/syscall/?GOOS=linux&GOARCH=amd64#Faccessat)
is now implemented just as in glibc. In earlier Go releases the
flags parameter was ignored.
<!-- CL 118658 -->
On Linux, the `flags` parameter to
[`Fchmodat`](/pkg/syscall/?GOOS=linux&GOARCH=amd64#Fchmodat)
is now validated. Linux's `fchmodat` doesn't support the `flags` parameter
so we now mimic glibc's behavior and return an error if it's non-zero.
<!-- CL 118658 -->
On Linux, the `flags` parameter to
[`Fchmodat`](/pkg/syscall/?GOOS=linux&GOARCH=amd64#Fchmodat)
is now validated. Linux's `fchmodat` doesn't support the `flags` parameter
so we now mimic glibc's behavior and return an error if it's non-zero.
<!-- syscall -->
[text/scanner](/pkg/text/scanner/)
#### [text/scanner](/pkg/text/scanner/)
: <!-- CL 112037 -->
The [`Scanner.Scan`](/pkg/text/scanner/#Scanner.Scan) method now returns
the [`RawString`](/pkg/text/scanner/#RawString) token
instead of [`String`](/pkg/text/scanner/#String)
for raw string literals.
<!-- CL 112037 -->
The [`Scanner.Scan`](/pkg/text/scanner/#Scanner.Scan) method now returns
the [`RawString`](/pkg/text/scanner/#RawString) token
instead of [`String`](/pkg/text/scanner/#String)
for raw string literals.
<!-- text/scanner -->
[text/template](/pkg/text/template/)
#### [text/template](/pkg/text/template/)
: <!-- CL 84480 -->
Modifying template variables via assignments is now permitted via the `=` token:
<!-- CL 84480 -->
Modifying template variables via assignments is now permitted via the `=` token:
{{ $v := "init" }}
{{ if true }}
{{ $v = "changed" }}
{{ end }}
v: {{ $v }} {{/* "changed" */}}
{{ $v := "init" }}
{{ if true }}
{{ $v = "changed" }}
{{ end }}
v: {{ $v }} {{/* "changed" */}}
<!-- CL 95215 -->
In previous versions untyped `nil` values passed to
template functions were ignored. They are now passed as normal
arguments.
<!-- CL 95215 -->
In previous versions untyped `nil` values passed to
template functions were ignored. They are now passed as normal
arguments.
<!-- text/template -->
[time](/pkg/time/)
#### [time](/pkg/time/)
: <!-- CL 98157 -->
Parsing of timezones denoted by sign and offset is now
supported. In previous versions, numeric timezone names
(such as `+03`) were not considered valid, and only
three-letter abbreviations (such as `MST`) were accepted
when expecting a timezone name.
<!-- CL 98157 -->
Parsing of timezones denoted by sign and offset is now
supported. In previous versions, numeric timezone names
(such as `+03`) were not considered valid, and only
three-letter abbreviations (such as `MST`) were accepted
when expecting a timezone name.
<!-- time -->

Просмотреть файл

@ -390,437 +390,437 @@ in mind.
<!-- TODO: CL 115677: https://golang.org/cl/115677: cmd/vet: check embedded field tags too -->
[bufio](/pkg/bufio/)
#### [bufio](/pkg/bufio/)
: <!-- CL 149297 -->
`Reader`'s [`UnreadRune`](/pkg/bufio/#Reader.UnreadRune) and
[`UnreadByte`](/pkg/bufio/#Reader.UnreadByte) methods will now return an error
if they are called after [`Peek`](/pkg/bufio/#Reader.Peek).
<!-- CL 149297 -->
`Reader`'s [`UnreadRune`](/pkg/bufio/#Reader.UnreadRune) and
[`UnreadByte`](/pkg/bufio/#Reader.UnreadByte) methods will now return an error
if they are called after [`Peek`](/pkg/bufio/#Reader.Peek).
<!-- bufio -->
[bytes](/pkg/bytes/)
#### [bytes](/pkg/bytes/)
: <!-- CL 137855 -->
The new function [`ReplaceAll`](/pkg/bytes/#ReplaceAll) returns a copy of
a byte slice with all non-overlapping instances of a value replaced by another.
<!-- CL 137855 -->
The new function [`ReplaceAll`](/pkg/bytes/#ReplaceAll) returns a copy of
a byte slice with all non-overlapping instances of a value replaced by another.
<!-- CL 145098 -->
A pointer to a zero-value [`Reader`](/pkg/bytes/#Reader) is now
functionally equivalent to [`NewReader`](/pkg/bytes/#NewReader)`(nil)`.
Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
<!-- CL 145098 -->
A pointer to a zero-value [`Reader`](/pkg/bytes/#Reader) is now
functionally equivalent to [`NewReader`](/pkg/bytes/#NewReader)`(nil)`.
Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
<!-- bytes -->
[crypto/rand](/pkg/crypto/rand/)
#### [crypto/rand](/pkg/crypto/rand/)
: <!-- CL 139419 -->
A warning will now be printed to standard error the first time
`Reader.Read` is blocked for more than 60 seconds waiting
to read entropy from the kernel.
<!-- CL 139419 -->
A warning will now be printed to standard error the first time
`Reader.Read` is blocked for more than 60 seconds waiting
to read entropy from the kernel.
<!-- CL 120055 -->
On FreeBSD, `Reader` now uses the `getrandom`
system call if available, `/dev/urandom` otherwise.
<!-- CL 120055 -->
On FreeBSD, `Reader` now uses the `getrandom`
system call if available, `/dev/urandom` otherwise.
<!-- crypto/rand -->
[crypto/rc4](/pkg/crypto/rc4/)
#### [crypto/rc4](/pkg/crypto/rc4/)
: <!-- CL 130397 -->
This release removes the assembly implementations, leaving only
the pure Go version. The Go compiler generates code that is
either slightly better or slightly worse, depending on the exact
CPU. RC4 is insecure and should only be used for compatibility
with legacy systems.
<!-- CL 130397 -->
This release removes the assembly implementations, leaving only
the pure Go version. The Go compiler generates code that is
either slightly better or slightly worse, depending on the exact
CPU. RC4 is insecure and should only be used for compatibility
with legacy systems.
<!-- crypto/rc4 -->
[crypto/tls](/pkg/crypto/tls/)
#### [crypto/tls](/pkg/crypto/tls/)
: <!-- CL 143177 -->
If a client sends an initial message that does not look like TLS, the server
will no longer reply with an alert, and it will expose the underlying
`net.Conn` in the new field `Conn` of
[`RecordHeaderError`](/pkg/crypto/tls/#RecordHeaderError).
<!-- CL 143177 -->
If a client sends an initial message that does not look like TLS, the server
will no longer reply with an alert, and it will expose the underlying
`net.Conn` in the new field `Conn` of
[`RecordHeaderError`](/pkg/crypto/tls/#RecordHeaderError).
<!-- crypto/tls -->
[database/sql](/pkg/database/sql/)
#### [database/sql](/pkg/database/sql/)
: <!-- CL 145738 -->
A query cursor can now be obtained by passing a
[`*Rows`](/pkg/database/sql/#Rows)
value to the [`Row.Scan`](/pkg/database/sql/#Row.Scan) method.
<!-- CL 145738 -->
A query cursor can now be obtained by passing a
[`*Rows`](/pkg/database/sql/#Rows)
value to the [`Row.Scan`](/pkg/database/sql/#Row.Scan) method.
<!-- database/sql -->
[expvar](/pkg/expvar/)
#### [expvar](/pkg/expvar/)
: <!-- CL 139537 -->
The new [`Delete`](/pkg/expvar/#Map.Delete) method allows
for deletion of key/value pairs from a [`Map`](/pkg/expvar/#Map).
<!-- CL 139537 -->
The new [`Delete`](/pkg/expvar/#Map.Delete) method allows
for deletion of key/value pairs from a [`Map`](/pkg/expvar/#Map).
<!-- expvar -->
[fmt](/pkg/fmt/)
#### [fmt](/pkg/fmt/)
: <!-- CL 142737 -->
Maps are now printed in key-sorted order to ease testing. The ordering rules are:
<!-- CL 142737 -->
Maps are now printed in key-sorted order to ease testing. The ordering rules are:
- When applicable, nil compares low
- ints, floats, and strings order by <
- NaN compares less than non-NaN floats
- bool compares false before true
- Complex compares real, then imaginary
- Pointers compare by machine address
- Channel values compare by machine address
- Structs compare each field in turn
- Arrays compare each element in turn
- Interface values compare first by `reflect.Type` describing the concrete type
and then by concrete value as described in the previous rules.
- When applicable, nil compares low
- ints, floats, and strings order by <
- NaN compares less than non-NaN floats
- bool compares false before true
- Complex compares real, then imaginary
- Pointers compare by machine address
- Channel values compare by machine address
- Structs compare each field in turn
- Arrays compare each element in turn
- Interface values compare first by `reflect.Type` describing the concrete type
and then by concrete value as described in the previous rules.
<!-- CL 129777 -->
When printing maps, non-reflexive key values like `NaN` were previously
displayed as `<nil>`. As of this release, the correct values are printed.
<!-- CL 129777 -->
When printing maps, non-reflexive key values like `NaN` were previously
displayed as `<nil>`. As of this release, the correct values are printed.
<!-- fmt -->
[go/doc](/pkg/go/doc/)
#### [go/doc](/pkg/go/doc/)
: <!-- CL 140958 -->
To address some outstanding issues in [`cmd/doc`](/cmd/doc/),
this package has a new [`Mode`](/pkg/go/doc/#Mode) bit,
`PreserveAST`, which controls whether AST data is cleared.
<!-- CL 140958 -->
To address some outstanding issues in [`cmd/doc`](/cmd/doc/),
this package has a new [`Mode`](/pkg/go/doc/#Mode) bit,
`PreserveAST`, which controls whether AST data is cleared.
<!-- go/doc -->
[go/token](/pkg/go/token/)
#### [go/token](/pkg/go/token/)
: <!-- CL 134075 -->
The [`File`](/pkg/go/token#File) type has a new
[`LineStart`](/pkg/go/token#File.LineStart) field,
which returns the position of the start of a given line. This is especially useful
in programs that occasionally handle non-Go files, such as assembly, but wish to use
the `token.Pos` mechanism to identify file positions.
<!-- CL 134075 -->
The [`File`](/pkg/go/token#File) type has a new
[`LineStart`](/pkg/go/token#File.LineStart) field,
which returns the position of the start of a given line. This is especially useful
in programs that occasionally handle non-Go files, such as assembly, but wish to use
the `token.Pos` mechanism to identify file positions.
<!-- go/token -->
[image](/pkg/image/)
#### [image](/pkg/image/)
: <!-- CL 118755 -->
The [`RegisterFormat`](/pkg/image/#RegisterFormat) function is now safe for concurrent use.
<!-- CL 118755 -->
The [`RegisterFormat`](/pkg/image/#RegisterFormat) function is now safe for concurrent use.
<!-- image -->
[image/png](/pkg/image/png/)
#### [image/png](/pkg/image/png/)
: <!-- CL 134235 -->
Paletted images with fewer than 16 colors now encode to smaller outputs.
<!-- CL 134235 -->
Paletted images with fewer than 16 colors now encode to smaller outputs.
<!-- image/png -->
[io](/pkg/io/)
#### [io](/pkg/io/)
: <!-- CL 139457 -->
The new [`StringWriter`](/pkg/io#StringWriter) interface wraps the
[`WriteString`](/pkg/io/#WriteString) function.
<!-- CL 139457 -->
The new [`StringWriter`](/pkg/io#StringWriter) interface wraps the
[`WriteString`](/pkg/io/#WriteString) function.
<!-- io -->
[math](/pkg/math/)
#### [math](/pkg/math/)
: <!-- CL 153059 -->
The functions
[`Sin`](/pkg/math/#Sin),
[`Cos`](/pkg/math/#Cos),
[`Tan`](/pkg/math/#Tan),
and [`Sincos`](/pkg/math/#Sincos) now
apply Payne-Hanek range reduction to huge arguments. This
produces more accurate answers, but they will not be bit-for-bit
identical with the results in earlier releases.
<!-- CL 153059 -->
The functions
[`Sin`](/pkg/math/#Sin),
[`Cos`](/pkg/math/#Cos),
[`Tan`](/pkg/math/#Tan),
and [`Sincos`](/pkg/math/#Sincos) now
apply Payne-Hanek range reduction to huge arguments. This
produces more accurate answers, but they will not be bit-for-bit
identical with the results in earlier releases.
<!-- math -->
[math/bits](/pkg/math/bits/)
#### [math/bits](/pkg/math/bits/)
: <!-- CL 123157 -->
New extended precision operations [`Add`](/pkg/math/bits/#Add), [`Sub`](/pkg/math/bits/#Sub), [`Mul`](/pkg/math/bits/#Mul), and [`Div`](/pkg/math/bits/#Div) are available in `uint`, `uint32`, and `uint64` versions.
<!-- CL 123157 -->
New extended precision operations [`Add`](/pkg/math/bits/#Add), [`Sub`](/pkg/math/bits/#Sub), [`Mul`](/pkg/math/bits/#Mul), and [`Div`](/pkg/math/bits/#Div) are available in `uint`, `uint32`, and `uint64` versions.
<!-- math/bits -->
[net](/pkg/net/)
#### [net](/pkg/net/)
: <!-- CL 146659 -->
The
[`Dialer.DualStack`](/pkg/net/#Dialer.DualStack) setting is now ignored and deprecated;
RFC 6555 Fast Fallback ("Happy Eyeballs") is now enabled by default. To disable, set
[`Dialer.FallbackDelay`](/pkg/net/#Dialer.FallbackDelay) to a negative value.
<!-- CL 146659 -->
The
[`Dialer.DualStack`](/pkg/net/#Dialer.DualStack) setting is now ignored and deprecated;
RFC 6555 Fast Fallback ("Happy Eyeballs") is now enabled by default. To disable, set
[`Dialer.FallbackDelay`](/pkg/net/#Dialer.FallbackDelay) to a negative value.
<!-- CL 107196 -->
Similarly, TCP keep-alives are now enabled by default if
[`Dialer.KeepAlive`](/pkg/net/#Dialer.KeepAlive) is zero.
To disable, set it to a negative value.
<!-- CL 107196 -->
Similarly, TCP keep-alives are now enabled by default if
[`Dialer.KeepAlive`](/pkg/net/#Dialer.KeepAlive) is zero.
To disable, set it to a negative value.
<!-- CL 113997 -->
On Linux, the [`splice` system call](https://man7.org/linux/man-pages/man2/splice.2.html) is now used when copying from a
[`UnixConn`](/pkg/net/#UnixConn) to a
[`TCPConn`](/pkg/net/#TCPConn).
<!-- CL 113997 -->
On Linux, the [`splice` system call](https://man7.org/linux/man-pages/man2/splice.2.html) is now used when copying from a
[`UnixConn`](/pkg/net/#UnixConn) to a
[`TCPConn`](/pkg/net/#TCPConn).
<!-- net -->
[net/http](/pkg/net/http/)
#### [net/http](/pkg/net/http/)
: <!-- CL 143177 -->
The HTTP server now rejects misdirected HTTP requests to HTTPS servers with a plaintext "400 Bad Request" response.
<!-- CL 143177 -->
The HTTP server now rejects misdirected HTTP requests to HTTPS servers with a plaintext "400 Bad Request" response.
<!-- CL 130115 -->
The new [`Client.CloseIdleConnections`](/pkg/net/http/#Client.CloseIdleConnections)
method calls the `Client`'s underlying `Transport`'s `CloseIdleConnections`
if it has one.
<!-- CL 130115 -->
The new [`Client.CloseIdleConnections`](/pkg/net/http/#Client.CloseIdleConnections)
method calls the `Client`'s underlying `Transport`'s `CloseIdleConnections`
if it has one.
<!-- CL 145398 -->
The [`Transport`](/pkg/net/http/#Transport) no longer rejects HTTP responses which declare
HTTP Trailers but don't use chunked encoding. Instead, the declared trailers are now just ignored.
<!-- CL 145398 -->
The [`Transport`](/pkg/net/http/#Transport) no longer rejects HTTP responses which declare
HTTP Trailers but don't use chunked encoding. Instead, the declared trailers are now just ignored.
<!-- CL 152080 -->
<!-- CL 151857 -->
The [`Transport`](/pkg/net/http/#Transport) no longer handles `MAX_CONCURRENT_STREAMS` values
advertised from HTTP/2 servers as strictly as it did during Go 1.10 and Go 1.11. The default behavior is now back
to how it was in Go 1.9: each connection to a server can have up to `MAX_CONCURRENT_STREAMS` requests
active and then new TCP connections are created as needed. In Go 1.10 and Go 1.11 the `http2` package
would block and wait for requests to finish instead of creating new connections.
To get the stricter behavior back, import the
[`golang.org/x/net/http2`](https://godoc.org/golang.org/x/net/http2) package
directly and set
[`Transport.StrictMaxConcurrentStreams`](https://godoc.org/golang.org/x/net/http2#Transport.StrictMaxConcurrentStreams) to
`true`.
<!-- CL 152080 -->
<!-- CL 151857 -->
The [`Transport`](/pkg/net/http/#Transport) no longer handles `MAX_CONCURRENT_STREAMS` values
advertised from HTTP/2 servers as strictly as it did during Go 1.10 and Go 1.11. The default behavior is now back
to how it was in Go 1.9: each connection to a server can have up to `MAX_CONCURRENT_STREAMS` requests
active and then new TCP connections are created as needed. In Go 1.10 and Go 1.11 the `http2` package
would block and wait for requests to finish instead of creating new connections.
To get the stricter behavior back, import the
[`golang.org/x/net/http2`](https://godoc.org/golang.org/x/net/http2) package
directly and set
[`Transport.StrictMaxConcurrentStreams`](https://godoc.org/golang.org/x/net/http2#Transport.StrictMaxConcurrentStreams) to
`true`.
<!-- net/http -->
[net/url](/pkg/net/url/)
#### [net/url](/pkg/net/url/)
: <!-- CL 159157, CL 160178 -->
[`Parse`](/pkg/net/url/#Parse),
[`ParseRequestURI`](/pkg/net/url/#ParseRequestURI),
and
[`URL.Parse`](/pkg/net/url/#URL.Parse)
now return an
error for URLs containing ASCII control characters, which includes NULL,
tab, and newlines.
<!-- CL 159157, CL 160178 -->
[`Parse`](/pkg/net/url/#Parse),
[`ParseRequestURI`](/pkg/net/url/#ParseRequestURI),
and
[`URL.Parse`](/pkg/net/url/#URL.Parse)
now return an
error for URLs containing ASCII control characters, which includes NULL,
tab, and newlines.
<!-- net/url -->
[net/http/httputil](/pkg/net/http/httputil/)
#### [net/http/httputil](/pkg/net/http/httputil/)
: <!-- CL 146437 -->
The [`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy) now automatically
proxies WebSocket requests.
<!-- CL 146437 -->
The [`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy) now automatically
proxies WebSocket requests.
<!-- net/http/httputil -->
[os](/pkg/os/)
#### [os](/pkg/os/)
: <!-- CL 125443 -->
The new [`ProcessState.ExitCode`](/pkg/os/#ProcessState.ExitCode) method
returns the process's exit code.
<!-- CL 125443 -->
The new [`ProcessState.ExitCode`](/pkg/os/#ProcessState.ExitCode) method
returns the process's exit code.
<!-- CL 135075 -->
`ModeCharDevice` has been added to the `ModeType` bitmask, allowing for
`ModeDevice | ModeCharDevice` to be recovered when masking a
[`FileMode`](/pkg/os/#FileMode) with `ModeType`.
<!-- CL 135075 -->
`ModeCharDevice` has been added to the `ModeType` bitmask, allowing for
`ModeDevice | ModeCharDevice` to be recovered when masking a
[`FileMode`](/pkg/os/#FileMode) with `ModeType`.
<!-- CL 139418 -->
The new function [`UserHomeDir`](/pkg/os/#UserHomeDir) returns the
current user's home directory.
<!-- CL 139418 -->
The new function [`UserHomeDir`](/pkg/os/#UserHomeDir) returns the
current user's home directory.
<!-- CL 146020 -->
[`RemoveAll`](/pkg/os/#RemoveAll) now supports paths longer than 4096 characters
on most Unix systems.
<!-- CL 146020 -->
[`RemoveAll`](/pkg/os/#RemoveAll) now supports paths longer than 4096 characters
on most Unix systems.
<!-- CL 130676 -->
[`File.Sync`](/pkg/os/#File.Sync) now uses `F_FULLFSYNC` on macOS
to correctly flush the file contents to permanent storage.
This may cause the method to run more slowly than in previous releases.
<!-- CL 130676 -->
[`File.Sync`](/pkg/os/#File.Sync) now uses `F_FULLFSYNC` on macOS
to correctly flush the file contents to permanent storage.
This may cause the method to run more slowly than in previous releases.
<!--CL 155517 -->
[`File`](/pkg/os/#File) now supports
a [`SyscallConn`](/pkg/os/#File.SyscallConn)
method returning
a [`syscall.RawConn`](/pkg/syscall/#RawConn)
interface value. This may be used to invoke system-specific
operations on the underlying file descriptor.
<!--CL 155517 -->
[`File`](/pkg/os/#File) now supports
a [`SyscallConn`](/pkg/os/#File.SyscallConn)
method returning
a [`syscall.RawConn`](/pkg/syscall/#RawConn)
interface value. This may be used to invoke system-specific
operations on the underlying file descriptor.
<!-- os -->
[path/filepath](/pkg/path/filepath/)
#### [path/filepath](/pkg/path/filepath/)
: <!-- CL 145220 -->
The [`IsAbs`](/pkg/path/filepath/#IsAbs) function now returns true when passed
a reserved filename on Windows such as `NUL`.
[List of reserved names.](https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#naming-conventions)
<!-- CL 145220 -->
The [`IsAbs`](/pkg/path/filepath/#IsAbs) function now returns true when passed
a reserved filename on Windows such as `NUL`.
[List of reserved names.](https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#naming-conventions)
<!-- path/filepath -->
[reflect](/pkg/reflect/)
#### [reflect](/pkg/reflect/)
: <!-- CL 33572 -->
A new [`MapIter`](/pkg/reflect#MapIter) type is
an iterator for ranging over a map. This type is exposed through the
[`Value`](/pkg/reflect#Value) type's new
[`MapRange`](/pkg/reflect#Value.MapRange) method.
This follows the same iteration semantics as a range statement, with `Next`
to advance the iterator, and `Key`/`Value` to access each entry.
<!-- CL 33572 -->
A new [`MapIter`](/pkg/reflect#MapIter) type is
an iterator for ranging over a map. This type is exposed through the
[`Value`](/pkg/reflect#Value) type's new
[`MapRange`](/pkg/reflect#Value.MapRange) method.
This follows the same iteration semantics as a range statement, with `Next`
to advance the iterator, and `Key`/`Value` to access each entry.
<!-- reflect -->
[regexp](/pkg/regexp/)
#### [regexp](/pkg/regexp/)
: <!-- CL 139784 -->
[`Copy`](/pkg/regexp/#Regexp.Copy) is no longer necessary
to avoid lock contention, so it has been given a partial deprecation comment.
[`Copy`](/pkg/regexp/#Regexp.Copy)
may still be appropriate if the reason for its use is to make two copies with
different [`Longest`](/pkg/regexp/#Regexp.Longest) settings.
<!-- CL 139784 -->
[`Copy`](/pkg/regexp/#Regexp.Copy) is no longer necessary
to avoid lock contention, so it has been given a partial deprecation comment.
[`Copy`](/pkg/regexp/#Regexp.Copy)
may still be appropriate if the reason for its use is to make two copies with
different [`Longest`](/pkg/regexp/#Regexp.Longest) settings.
<!-- regexp -->
[runtime/debug](/pkg/runtime/debug/)
#### [runtime/debug](/pkg/runtime/debug/)
: <!-- CL 144220 -->
A new [`BuildInfo`](/pkg/runtime/debug/#BuildInfo) type
exposes the build information read from the running binary, available only in
binaries built with module support. This includes the main package path, main
module information, and the module dependencies. This type is given through the
[`ReadBuildInfo`](/pkg/runtime/debug/#ReadBuildInfo) function
on [`BuildInfo`](/pkg/runtime/debug/#BuildInfo).
<!-- CL 144220 -->
A new [`BuildInfo`](/pkg/runtime/debug/#BuildInfo) type
exposes the build information read from the running binary, available only in
binaries built with module support. This includes the main package path, main
module information, and the module dependencies. This type is given through the
[`ReadBuildInfo`](/pkg/runtime/debug/#ReadBuildInfo) function
on [`BuildInfo`](/pkg/runtime/debug/#BuildInfo).
<!-- runtime/debug -->
[strings](/pkg/strings/)
#### [strings](/pkg/strings/)
: <!-- CL 137855 -->
The new function [`ReplaceAll`](/pkg/strings/#ReplaceAll) returns a copy of
a string with all non-overlapping instances of a value replaced by another.
<!-- CL 137855 -->
The new function [`ReplaceAll`](/pkg/strings/#ReplaceAll) returns a copy of
a string with all non-overlapping instances of a value replaced by another.
<!-- CL 145098 -->
A pointer to a zero-value [`Reader`](/pkg/strings/#Reader) is now
functionally equivalent to [`NewReader`](/pkg/strings/#NewReader)`(nil)`.
Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
<!-- CL 145098 -->
A pointer to a zero-value [`Reader`](/pkg/strings/#Reader) is now
functionally equivalent to [`NewReader`](/pkg/strings/#NewReader)`(nil)`.
Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
<!-- CL 122835 -->
The new [`Builder.Cap`](/pkg/strings/#Builder.Cap) method returns the capacity of the builder's underlying byte slice.
<!-- CL 122835 -->
The new [`Builder.Cap`](/pkg/strings/#Builder.Cap) method returns the capacity of the builder's underlying byte slice.
<!-- CL 131495 -->
The character mapping functions [`Map`](/pkg/strings/#Map),
[`Title`](/pkg/strings/#Title),
[`ToLower`](/pkg/strings/#ToLower),
[`ToLowerSpecial`](/pkg/strings/#ToLowerSpecial),
[`ToTitle`](/pkg/strings/#ToTitle),
[`ToTitleSpecial`](/pkg/strings/#ToTitleSpecial),
[`ToUpper`](/pkg/strings/#ToUpper), and
[`ToUpperSpecial`](/pkg/strings/#ToUpperSpecial)
now always guarantee to return valid UTF-8. In earlier releases, if the input was invalid UTF-8 but no character replacements
needed to be applied, these routines incorrectly returned the invalid UTF-8 unmodified.
<!-- CL 131495 -->
The character mapping functions [`Map`](/pkg/strings/#Map),
[`Title`](/pkg/strings/#Title),
[`ToLower`](/pkg/strings/#ToLower),
[`ToLowerSpecial`](/pkg/strings/#ToLowerSpecial),
[`ToTitle`](/pkg/strings/#ToTitle),
[`ToTitleSpecial`](/pkg/strings/#ToTitleSpecial),
[`ToUpper`](/pkg/strings/#ToUpper), and
[`ToUpperSpecial`](/pkg/strings/#ToUpperSpecial)
now always guarantee to return valid UTF-8. In earlier releases, if the input was invalid UTF-8 but no character replacements
needed to be applied, these routines incorrectly returned the invalid UTF-8 unmodified.
<!-- strings -->
[syscall](/pkg/syscall/)
#### [syscall](/pkg/syscall/)
: <!-- CL 138595 -->
64-bit inodes are now supported on FreeBSD 12. Some types have been adjusted accordingly.
<!-- CL 138595 -->
64-bit inodes are now supported on FreeBSD 12. Some types have been adjusted accordingly.
<!-- CL 125456 -->
The Unix socket
([`AF_UNIX`](https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/))
address family is now supported for compatible versions of Windows.
<!-- CL 125456 -->
The Unix socket
([`AF_UNIX`](https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/))
address family is now supported for compatible versions of Windows.
<!-- CL 147117 -->
The new function [`Syscall18`](/pkg/syscall/?GOOS=windows&GOARCH=amd64#Syscall18)
has been introduced for Windows, allowing for calls with up to 18 arguments.
<!-- CL 147117 -->
The new function [`Syscall18`](/pkg/syscall/?GOOS=windows&GOARCH=amd64#Syscall18)
has been introduced for Windows, allowing for calls with up to 18 arguments.
<!-- syscall -->
[syscall/js](/pkg/syscall/js/)
#### [syscall/js](/pkg/syscall/js/)
: <!-- CL 153559 -->
<!-- CL 153559 -->
The `Callback` type and `NewCallback` function have been renamed;
they are now called
[`Func`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Func) and
[`FuncOf`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#FuncOf), respectively.
This is a breaking change, but WebAssembly support is still experimental
and not yet subject to the
[Go 1 compatibility promise](/doc/go1compat). Any code using the
old names will need to be updated.
The `Callback` type and `NewCallback` function have been renamed;
they are now called
[`Func`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Func) and
[`FuncOf`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#FuncOf), respectively.
This is a breaking change, but WebAssembly support is still experimental
and not yet subject to the
[Go 1 compatibility promise](/doc/go1compat). Any code using the
old names will need to be updated.
<!-- CL 141644 -->
If a type implements the new
[`Wrapper`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Wrapper)
interface,
[`ValueOf`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#ValueOf)
will use it to return the JavaScript value for that type.
<!-- CL 141644 -->
If a type implements the new
[`Wrapper`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Wrapper)
interface,
[`ValueOf`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#ValueOf)
will use it to return the JavaScript value for that type.
<!-- CL 143137 -->
The meaning of the zero
[`Value`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value)
has changed. It now represents the JavaScript `undefined` value
instead of the number zero.
This is a breaking change, but WebAssembly support is still experimental
and not yet subject to the
[Go 1 compatibility promise](/doc/go1compat). Any code relying on
the zero [`Value`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value)
to mean the number zero will need to be updated.
<!-- CL 143137 -->
The meaning of the zero
[`Value`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value)
has changed. It now represents the JavaScript `undefined` value
instead of the number zero.
This is a breaking change, but WebAssembly support is still experimental
and not yet subject to the
[Go 1 compatibility promise](/doc/go1compat). Any code relying on
the zero [`Value`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value)
to mean the number zero will need to be updated.
<!-- CL 144384 -->
The new
[`Value.Truthy`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value.Truthy)
method reports the
[JavaScript "truthiness"](https://developer.mozilla.org/en-US/docs/Glossary/Truthy)
of a given value.
<!-- CL 144384 -->
The new
[`Value.Truthy`](/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value.Truthy)
method reports the
[JavaScript "truthiness"](https://developer.mozilla.org/en-US/docs/Glossary/Truthy)
of a given value.
<!-- syscall/js -->
[testing](/pkg/testing/)
#### [testing](/pkg/testing/)
: <!-- CL 139258 -->
The [`-benchtime`](/cmd/go/#hdr-Testing_flags) flag now supports setting an explicit iteration count instead of a time when the value ends with an "`x`". For example, `-benchtime=100x` runs the benchmark 100 times.
<!-- CL 139258 -->
The [`-benchtime`](/cmd/go/#hdr-Testing_flags) flag now supports setting an explicit iteration count instead of a time when the value ends with an "`x`". For example, `-benchtime=100x` runs the benchmark 100 times.
<!-- testing -->
[text/template](/pkg/text/template/)
#### [text/template](/pkg/text/template/)
: <!-- CL 142217 -->
When executing a template, long context values are no longer truncated in errors.
<!-- CL 142217 -->
When executing a template, long context values are no longer truncated in errors.
`executing "tmpl" at <.very.deep.context.v...>: map has no entry for key "notpresent"`
`executing "tmpl" at <.very.deep.context.v...>: map has no entry for key "notpresent"`
is now
is now
`executing "tmpl" at <.very.deep.context.value.notpresent>: map has no entry for key "notpresent"`
`executing "tmpl" at <.very.deep.context.value.notpresent>: map has no entry for key "notpresent"`
<!-- CL 143097 -->
If a user-defined function called by a template panics, the
panic is now caught and returned as an error by
the `Execute` or `ExecuteTemplate` method.
<!-- CL 143097 -->
If a user-defined function called by a template panics, the
panic is now caught and returned as an error by
the `Execute` or `ExecuteTemplate` method.
<!-- text/template -->
[time](/pkg/time/)
#### [time](/pkg/time/)
: <!-- CL 151299 -->
The time zone database in `$GOROOT/lib/time/zoneinfo.zip`
has been updated to version 2018i. Note that this ZIP file is
only used if a time zone database is not provided by the operating
system.
<!-- CL 151299 -->
The time zone database in `$GOROOT/lib/time/zoneinfo.zip`
has been updated to version 2018i. Note that this ZIP file is
only used if a time zone database is not provided by the operating
system.
<!-- time -->
[unsafe](/pkg/unsafe/)
#### [unsafe](/pkg/unsafe/)
: <!-- CL 146058 -->
It is invalid to convert a nil `unsafe.Pointer` to `uintptr` and back with arithmetic.
(This was already invalid, but will now cause the compiler to misbehave.)
<!-- CL 146058 -->
It is invalid to convert a nil `unsafe.Pointer` to `uintptr` and back with arithmetic.
(This was already invalid, but will now cause the compiler to misbehave.)
<!-- unsafe -->

Просмотреть файл

@ -478,434 +478,434 @@ As always, there are various minor changes and updates to the library,
made with the Go 1 [promise of compatibility](/doc/go1compat)
in mind.
[bytes](/pkg/bytes/)
#### [bytes](/pkg/bytes/)
: The new [`ToValidUTF8`](/pkg/bytes/#ToValidUTF8) function returns a
copy of a given byte slice with each run of invalid UTF-8 byte sequences replaced by a given slice.
The new [`ToValidUTF8`](/pkg/bytes/#ToValidUTF8) function returns a
copy of a given byte slice with each run of invalid UTF-8 byte sequences replaced by a given slice.
<!-- bytes -->
[context](/pkg/context/)
#### [context](/pkg/context/)
: <!-- CL 169080 -->
The formatting of contexts returned by [`WithValue`](/pkg/context/#WithValue) no longer depends on `fmt` and will not stringify in the same way. Code that depends on the exact previous stringification might be affected.
<!-- CL 169080 -->
The formatting of contexts returned by [`WithValue`](/pkg/context/#WithValue) no longer depends on `fmt` and will not stringify in the same way. Code that depends on the exact previous stringification might be affected.
<!-- context -->
[crypto/tls](/pkg/crypto/tls/)
#### [crypto/tls](/pkg/crypto/tls/)
: Support for SSL version 3.0 (SSLv3) [
is now deprecated and will be removed in Go 1.14](/issue/32716). Note that SSLv3 is the
[cryptographically broken](https://tools.ietf.org/html/rfc7568)
protocol predating TLS.
Support for SSL version 3.0 (SSLv3) [
is now deprecated and will be removed in Go 1.14](/issue/32716). Note that SSLv3 is the
[cryptographically broken](https://tools.ietf.org/html/rfc7568)
protocol predating TLS.
SSLv3 was always disabled by default, other than in Go 1.12, when it was
mistakenly enabled by default server-side. It is now again disabled by
default. (SSLv3 was never supported client-side.)
SSLv3 was always disabled by default, other than in Go 1.12, when it was
mistakenly enabled by default server-side. It is now again disabled by
default. (SSLv3 was never supported client-side.)
<!-- CL 177698 -->
Ed25519 certificates are now supported in TLS versions 1.2 and 1.3.
<!-- CL 177698 -->
Ed25519 certificates are now supported in TLS versions 1.2 and 1.3.
<!-- crypto/tls -->
[crypto/x509](/pkg/crypto/x509/)
#### [crypto/x509](/pkg/crypto/x509/)
: <!-- CL 175478 -->
Ed25519 keys are now supported in certificates and certificate requests
according to [RFC 8410](https://www.rfc-editor.org/info/rfc8410), as well as by the
[`ParsePKCS8PrivateKey`](/pkg/crypto/x509/#ParsePKCS8PrivateKey),
[`MarshalPKCS8PrivateKey`](/pkg/crypto/x509/#MarshalPKCS8PrivateKey),
and [`ParsePKIXPublicKey`](/pkg/crypto/x509/#ParsePKIXPublicKey) functions.
<!-- CL 175478 -->
Ed25519 keys are now supported in certificates and certificate requests
according to [RFC 8410](https://www.rfc-editor.org/info/rfc8410), as well as by the
[`ParsePKCS8PrivateKey`](/pkg/crypto/x509/#ParsePKCS8PrivateKey),
[`MarshalPKCS8PrivateKey`](/pkg/crypto/x509/#MarshalPKCS8PrivateKey),
and [`ParsePKIXPublicKey`](/pkg/crypto/x509/#ParsePKIXPublicKey) functions.
<!-- CL 169238 -->
The paths searched for system roots now include `/etc/ssl/cert.pem`
to support the default location in Alpine Linux 3.7+.
<!-- CL 169238 -->
The paths searched for system roots now include `/etc/ssl/cert.pem`
to support the default location in Alpine Linux 3.7+.
<!-- crypto/x509 -->
[database/sql](/pkg/database/sql/)
#### [database/sql](/pkg/database/sql/)
: <!-- CL 170699 -->
The new [`NullTime`](/pkg/database/sql/#NullTime) type represents a `time.Time` that may be null.
<!-- CL 170699 -->
The new [`NullTime`](/pkg/database/sql/#NullTime) type represents a `time.Time` that may be null.
<!-- CL 174178 -->
The new [`NullInt32`](/pkg/database/sql/#NullInt32) type represents an `int32` that may be null.
<!-- CL 174178 -->
The new [`NullInt32`](/pkg/database/sql/#NullInt32) type represents an `int32` that may be null.
<!-- database/sql -->
[debug/dwarf](/pkg/debug/dwarf/)
#### [debug/dwarf](/pkg/debug/dwarf/)
: <!-- CL 158797 -->
The [`Data.Type`](/pkg/debug/dwarf/#Data.Type)
method no longer panics if it encounters an unknown DWARF tag in
the type graph. Instead, it represents that component of the
type with
an [`UnsupportedType`](/pkg/debug/dwarf/#UnsupportedType)
object.
<!-- CL 158797 -->
The [`Data.Type`](/pkg/debug/dwarf/#Data.Type)
method no longer panics if it encounters an unknown DWARF tag in
the type graph. Instead, it represents that component of the
type with
an [`UnsupportedType`](/pkg/debug/dwarf/#UnsupportedType)
object.
<!-- debug/dwarf -->
[errors](/pkg/errors/)
#### [errors](/pkg/errors/)
: <!-- CL 163558 -->
<!-- CL 163558 -->
The new function [`As`](/pkg/errors/#As) finds the first
error in a given errors chain (sequence of wrapped errors)
that matches a given targets type, and if so, sets the target to that error value.
The new function [`As`](/pkg/errors/#As) finds the first
error in a given errors chain (sequence of wrapped errors)
that matches a given targets type, and if so, sets the target to that error value.
The new function [`Is`](/pkg/errors/#Is) reports whether a given error value matches an
error in anothers chain.
The new function [`Is`](/pkg/errors/#Is) reports whether a given error value matches an
error in anothers chain.
The new function [`Unwrap`](/pkg/errors/#Unwrap) returns the result of calling
`Unwrap` on a given error, if one exists.
The new function [`Unwrap`](/pkg/errors/#Unwrap) returns the result of calling
`Unwrap` on a given error, if one exists.
<!-- errors -->
[fmt](/pkg/fmt/)
#### [fmt](/pkg/fmt/)
: <!-- CL 160245 -->
<!-- CL 160245 -->
The printing verbs `%x` and `%X` now format floating-point and
complex numbers in hexadecimal notation, in lower-case and upper-case respectively.
The printing verbs `%x` and `%X` now format floating-point and
complex numbers in hexadecimal notation, in lower-case and upper-case respectively.
<!-- CL 160246 -->
<!-- CL 160246 -->
The new printing verb `%O` formats integers in base 8, emitting the `0o` prefix.
The new printing verb `%O` formats integers in base 8, emitting the `0o` prefix.
<!-- CL 160247 -->
<!-- CL 160247 -->
The scanner now accepts hexadecimal floating-point values, digit-separating underscores
and leading `0b` and `0o` prefixes.
See the [Changes to the language](#language) for details.
The scanner now accepts hexadecimal floating-point values, digit-separating underscores
and leading `0b` and `0o` prefixes.
See the [Changes to the language](#language) for details.
<!-- CL 176998 -->
<!-- CL 176998 -->
The [`Errorf`](/pkg/fmt/#Errorf) function
has a new verb, `%w`, whose operand must be an error.
The error returned from `Errorf` will have an
`Unwrap` method which returns the operand of `%w`.
The [`Errorf`](/pkg/fmt/#Errorf) function
has a new verb, `%w`, whose operand must be an error.
The error returned from `Errorf` will have an
`Unwrap` method which returns the operand of `%w`.
<!-- fmt -->
[go/scanner](/pkg/go/scanner/)
#### [go/scanner](/pkg/go/scanner/)
: <!-- CL 175218 -->
The scanner has been updated to recognize the new Go number literals, specifically
binary literals with `0b`/`0B` prefix, octal literals with `0o`/`0O` prefix,
and floating-point numbers with hexadecimal mantissa. The imaginary suffix `i` may now be used with any number
literal, and underscores may be used as digit separators for grouping.
See the [Changes to the language](#language) for details.
<!-- CL 175218 -->
The scanner has been updated to recognize the new Go number literals, specifically
binary literals with `0b`/`0B` prefix, octal literals with `0o`/`0O` prefix,
and floating-point numbers with hexadecimal mantissa. The imaginary suffix `i` may now be used with any number
literal, and underscores may be used as digit separators for grouping.
See the [Changes to the language](#language) for details.
<!-- go/scanner -->
[go/types](/pkg/go/types/)
#### [go/types](/pkg/go/types/)
: The type-checker has been updated to follow the new rules for integer shifts.
See the [Changes to the language](#language) for details.
The type-checker has been updated to follow the new rules for integer shifts.
See the [Changes to the language](#language) for details.
<!-- go/types -->
[html/template](/pkg/html/template/)
#### [html/template](/pkg/html/template/)
: <!-- CL 175218 -->
When using a `<script>` tag with "module" set as the
type attribute, code will now be interpreted as [JavaScript module script](https://html.spec.whatwg.org/multipage/scripting.html#the-script-element:module-script-2).
<!-- CL 175218 -->
When using a `<script>` tag with "module" set as the
type attribute, code will now be interpreted as [JavaScript module script](https://html.spec.whatwg.org/multipage/scripting.html#the-script-element:module-script-2).
<!-- html/template -->
[log](/pkg/log/)
#### [log](/pkg/log/)
: <!-- CL 168920 -->
The new [`Writer`](/pkg/log/#Writer) function returns the output destination for the standard logger.
<!-- CL 168920 -->
The new [`Writer`](/pkg/log/#Writer) function returns the output destination for the standard logger.
<!-- log -->
[math/big](/pkg/math/big/)
#### [math/big](/pkg/math/big/)
: <!-- CL 160682 -->
The new [`Rat.SetUint64`](/pkg/math/big/#Rat.SetUint64) method sets the `Rat` to a `uint64` value.
<!-- CL 160682 -->
The new [`Rat.SetUint64`](/pkg/math/big/#Rat.SetUint64) method sets the `Rat` to a `uint64` value.
<!-- CL 166157 -->
For [`Float.Parse`](/pkg/math/big/#Float.Parse), if base is 0, underscores
may be used between digits for readability.
See the [Changes to the language](#language) for details.
<!-- CL 166157 -->
For [`Float.Parse`](/pkg/math/big/#Float.Parse), if base is 0, underscores
may be used between digits for readability.
See the [Changes to the language](#language) for details.
<!-- CL 166157 -->
For [`Int.SetString`](/pkg/math/big/#Int.SetString), if base is 0, underscores
may be used between digits for readability.
See the [Changes to the language](#language) for details.
<!-- CL 166157 -->
For [`Int.SetString`](/pkg/math/big/#Int.SetString), if base is 0, underscores
may be used between digits for readability.
See the [Changes to the language](#language) for details.
<!-- CL 168237 -->
[`Rat.SetString`](/pkg/math/big/#Rat.SetString) now accepts non-decimal floating point representations.
<!-- CL 168237 -->
[`Rat.SetString`](/pkg/math/big/#Rat.SetString) now accepts non-decimal floating point representations.
<!-- math/big -->
[math/bits](/pkg/math/bits/)
#### [math/bits](/pkg/math/bits/)
: <!-- CL 178177 -->
The execution time of [`Add`](/pkg/math/bits/#Add),
[`Sub`](/pkg/math/bits/#Sub),
[`Mul`](/pkg/math/bits/#Mul),
[`RotateLeft`](/pkg/math/bits/#RotateLeft), and
[`ReverseBytes`](/pkg/math/bits/#ReverseBytes) is now
guaranteed to be independent of the inputs.
<!-- CL 178177 -->
The execution time of [`Add`](/pkg/math/bits/#Add),
[`Sub`](/pkg/math/bits/#Sub),
[`Mul`](/pkg/math/bits/#Mul),
[`RotateLeft`](/pkg/math/bits/#RotateLeft), and
[`ReverseBytes`](/pkg/math/bits/#ReverseBytes) is now
guaranteed to be independent of the inputs.
<!-- math/bits -->
[net](/pkg/net/)
#### [net](/pkg/net/)
: <!-- CL 156366 -->
On Unix systems where `use-vc` is set in `resolv.conf`, TCP is used for DNS resolution.
<!-- CL 156366 -->
On Unix systems where `use-vc` is set in `resolv.conf`, TCP is used for DNS resolution.
<!-- CL 170678 -->
The new field [`ListenConfig.KeepAlive`](/pkg/net/#ListenConfig.KeepAlive)
specifies the keep-alive period for network connections accepted by the listener.
If this field is 0 (the default) TCP keep-alives will be enabled.
To disable them, set it to a negative value.
<!-- CL 170678 -->
The new field [`ListenConfig.KeepAlive`](/pkg/net/#ListenConfig.KeepAlive)
specifies the keep-alive period for network connections accepted by the listener.
If this field is 0 (the default) TCP keep-alives will be enabled.
To disable them, set it to a negative value.
Note that the error returned from I/O on a connection that was
closed by a keep-alive timeout will have a
`Timeout` method that returns `true` if called.
This can make a keep-alive error difficult to distinguish from
an error returned due to a missed deadline as set by the
[`SetDeadline`](/pkg/net/#Conn)
method and similar methods.
Code that uses deadlines and checks for them with
the `Timeout` method or
with [`os.IsTimeout`](/pkg/os/#IsTimeout)
may want to disable keep-alives, or
use `errors.Is(syscall.ETIMEDOUT)` (on Unix systems)
which will return true for a keep-alive timeout and false for a
deadline timeout.
Note that the error returned from I/O on a connection that was
closed by a keep-alive timeout will have a
`Timeout` method that returns `true` if called.
This can make a keep-alive error difficult to distinguish from
an error returned due to a missed deadline as set by the
[`SetDeadline`](/pkg/net/#Conn)
method and similar methods.
Code that uses deadlines and checks for them with
the `Timeout` method or
with [`os.IsTimeout`](/pkg/os/#IsTimeout)
may want to disable keep-alives, or
use `errors.Is(syscall.ETIMEDOUT)` (on Unix systems)
which will return true for a keep-alive timeout and false for a
deadline timeout.
<!-- net -->
[net/http](/pkg/net/http/)
#### [net/http](/pkg/net/http/)
: <!-- CL 76410 -->
The new fields [`Transport.WriteBufferSize`](/pkg/net/http/#Transport.WriteBufferSize)
and [`Transport.ReadBufferSize`](/pkg/net/http/#Transport.ReadBufferSize)
allow one to specify the sizes of the write and read buffers for a [`Transport`](/pkg/net/http/#Transport).
If either field is zero, a default size of 4KB is used.
<!-- CL 76410 -->
The new fields [`Transport.WriteBufferSize`](/pkg/net/http/#Transport.WriteBufferSize)
and [`Transport.ReadBufferSize`](/pkg/net/http/#Transport.ReadBufferSize)
allow one to specify the sizes of the write and read buffers for a [`Transport`](/pkg/net/http/#Transport).
If either field is zero, a default size of 4KB is used.
<!-- CL 130256 -->
The new field [`Transport.ForceAttemptHTTP2`](/pkg/net/http/#Transport.ForceAttemptHTTP2)
controls whether HTTP/2 is enabled when a non-zero `Dial`, `DialTLS`, or `DialContext`
func or `TLSClientConfig` is provided.
<!-- CL 130256 -->
The new field [`Transport.ForceAttemptHTTP2`](/pkg/net/http/#Transport.ForceAttemptHTTP2)
controls whether HTTP/2 is enabled when a non-zero `Dial`, `DialTLS`, or `DialContext`
func or `TLSClientConfig` is provided.
<!-- CL 140357 -->
[`Transport.MaxConnsPerHost`](/pkg/net/http/#Transport.MaxConnsPerHost) now works
properly with HTTP/2.
<!-- CL 140357 -->
[`Transport.MaxConnsPerHost`](/pkg/net/http/#Transport.MaxConnsPerHost) now works
properly with HTTP/2.
<!-- CL 154383 -->
[`TimeoutHandler`](/pkg/net/http/#TimeoutHandler)'s
[`ResponseWriter`](/pkg/net/http/#ResponseWriter) now implements the
[`Pusher`](/pkg/net/http/#Pusher) interface.
<!-- CL 154383 -->
[`TimeoutHandler`](/pkg/net/http/#TimeoutHandler)'s
[`ResponseWriter`](/pkg/net/http/#ResponseWriter) now implements the
[`Pusher`](/pkg/net/http/#Pusher) interface.
<!-- CL 157339 -->
The `StatusCode` `103` `"Early Hints"` has been added.
<!-- CL 157339 -->
The `StatusCode` `103` `"Early Hints"` has been added.
<!-- CL 163599 -->
[`Transport`](/pkg/net/http/#Transport) now uses the [`Request.Body`](/pkg/net/http/#Request.Body)'s
[`io.ReaderFrom`](/pkg/io/#ReaderFrom) implementation if available, to optimize writing the body.
<!-- CL 163599 -->
[`Transport`](/pkg/net/http/#Transport) now uses the [`Request.Body`](/pkg/net/http/#Request.Body)'s
[`io.ReaderFrom`](/pkg/io/#ReaderFrom) implementation if available, to optimize writing the body.
<!-- CL 167017 -->
On encountering unsupported transfer-encodings, [`http.Server`](/pkg/net/http/#Server) now
returns a "501 Unimplemented" status as mandated by the HTTP specification [RFC 7230 Section 3.3.1](https://tools.ietf.org/html/rfc7230#section-3.3.1).
<!-- CL 167017 -->
On encountering unsupported transfer-encodings, [`http.Server`](/pkg/net/http/#Server) now
returns a "501 Unimplemented" status as mandated by the HTTP specification [RFC 7230 Section 3.3.1](https://tools.ietf.org/html/rfc7230#section-3.3.1).
<!-- CL 167681 -->
The new [`Server`](/pkg/net/http/#Server) fields
[`BaseContext`](/pkg/net/http/#Server.BaseContext) and
[`ConnContext`](/pkg/net/http/#Server.ConnContext)
allow finer control over the [`Context`](/pkg/context/#Context) values provided to requests and connections.
<!-- CL 167681 -->
The new [`Server`](/pkg/net/http/#Server) fields
[`BaseContext`](/pkg/net/http/#Server.BaseContext) and
[`ConnContext`](/pkg/net/http/#Server.ConnContext)
allow finer control over the [`Context`](/pkg/context/#Context) values provided to requests and connections.
<!-- CL 167781 -->
[`http.DetectContentType`](/pkg/net/http/#DetectContentType) now correctly detects RAR signatures, and can now also detect RAR v5 signatures.
<!-- CL 167781 -->
[`http.DetectContentType`](/pkg/net/http/#DetectContentType) now correctly detects RAR signatures, and can now also detect RAR v5 signatures.
<!-- CL 173658 -->
The new [`Header`](/pkg/net/http/#Header) method
[`Clone`](/pkg/net/http/#Header.Clone) returns a copy of the receiver.
<!-- CL 173658 -->
The new [`Header`](/pkg/net/http/#Header) method
[`Clone`](/pkg/net/http/#Header.Clone) returns a copy of the receiver.
<!-- CL 174324 -->
A new function [`NewRequestWithContext`](/pkg/net/http/#NewRequestWithContext) has been added and it
accepts a [`Context`](/pkg/context/#Context) that controls the entire lifetime of
the created outgoing [`Request`](/pkg/net/http/#Request), suitable for use with
[`Client.Do`](/pkg/net/http/#Client.Do) and [`Transport.RoundTrip`](/pkg/net/http/#Transport.RoundTrip).
<!-- CL 174324 -->
A new function [`NewRequestWithContext`](/pkg/net/http/#NewRequestWithContext) has been added and it
accepts a [`Context`](/pkg/context/#Context) that controls the entire lifetime of
the created outgoing [`Request`](/pkg/net/http/#Request), suitable for use with
[`Client.Do`](/pkg/net/http/#Client.Do) and [`Transport.RoundTrip`](/pkg/net/http/#Transport.RoundTrip).
<!-- CL 179457 -->
The [`Transport`](/pkg/net/http/#Transport) no longer logs errors when servers
gracefully shut down idle connections using a `"408 Request Timeout"` response.
<!-- CL 179457 -->
The [`Transport`](/pkg/net/http/#Transport) no longer logs errors when servers
gracefully shut down idle connections using a `"408 Request Timeout"` response.
<!-- net/http -->
[os](/pkg/os/)
#### [os](/pkg/os/)
: <!-- CL 160877 -->
The new [`UserConfigDir`](/pkg/os/#UserConfigDir) function
returns the default directory to use for user-specific configuration data.
<!-- CL 160877 -->
The new [`UserConfigDir`](/pkg/os/#UserConfigDir) function
returns the default directory to use for user-specific configuration data.
<!-- CL 166578 -->
If a [`File`](/pkg/os/#File) is opened using the O\_APPEND flag, its
[`WriteAt`](/pkg/os/#File.WriteAt) method will always return an error.
<!-- CL 166578 -->
If a [`File`](/pkg/os/#File) is opened using the O\_APPEND flag, its
[`WriteAt`](/pkg/os/#File.WriteAt) method will always return an error.
<!-- os -->
[os/exec](/pkg/os/exec/)
#### [os/exec](/pkg/os/exec/)
: <!-- CL 174318 -->
On Windows, the environment for a [`Cmd`](/pkg/os/exec/#Cmd) always inherits the
`%SYSTEMROOT%` value of the parent process unless the
[`Cmd.Env`](/pkg/os/exec/#Cmd.Env) field includes an explicit value for it.
<!-- CL 174318 -->
On Windows, the environment for a [`Cmd`](/pkg/os/exec/#Cmd) always inherits the
`%SYSTEMROOT%` value of the parent process unless the
[`Cmd.Env`](/pkg/os/exec/#Cmd.Env) field includes an explicit value for it.
<!-- os/exec -->
[reflect](/pkg/reflect/)
#### [reflect](/pkg/reflect/)
: <!-- CL 171337 -->
The new [`Value.IsZero`](/pkg/reflect/#Value.IsZero) method reports whether a `Value` is the zero value for its type.
<!-- CL 171337 -->
The new [`Value.IsZero`](/pkg/reflect/#Value.IsZero) method reports whether a `Value` is the zero value for its type.
<!-- CL 174531 -->
The [`MakeFunc`](/pkg/reflect/#MakeFunc) function now allows assignment conversions on returned values, instead of requiring exact type match. This is particularly useful when the type being returned is an interface type, but the value actually returned is a concrete value implementing that type.
<!-- CL 174531 -->
The [`MakeFunc`](/pkg/reflect/#MakeFunc) function now allows assignment conversions on returned values, instead of requiring exact type match. This is particularly useful when the type being returned is an interface type, but the value actually returned is a concrete value implementing that type.
<!-- reflect -->
[runtime](/pkg/runtime/)
#### [runtime](/pkg/runtime/)
: <!-- CL 167780 -->
Tracebacks, [`runtime.Caller`](/pkg/runtime/#Caller),
and [`runtime.Callers`](/pkg/runtime/#Callers) now refer to the function that
initializes the global variables of `PKG`
as `PKG.init` instead of `PKG.init.ializers`.
<!-- CL 167780 -->
Tracebacks, [`runtime.Caller`](/pkg/runtime/#Caller),
and [`runtime.Callers`](/pkg/runtime/#Callers) now refer to the function that
initializes the global variables of `PKG`
as `PKG.init` instead of `PKG.init.ializers`.
<!-- runtime -->
[strconv](/pkg/strconv/)
#### [strconv](/pkg/strconv/)
: <!-- CL 160243 -->
For [`strconv.ParseFloat`](/pkg/strconv/#ParseFloat),
[`strconv.ParseInt`](/pkg/strconv/#ParseInt)
and [`strconv.ParseUint`](/pkg/strconv/#ParseUint),
if base is 0, underscores may be used between digits for readability.
See the [Changes to the language](#language) for details.
<!-- CL 160243 -->
For [`strconv.ParseFloat`](/pkg/strconv/#ParseFloat),
[`strconv.ParseInt`](/pkg/strconv/#ParseInt)
and [`strconv.ParseUint`](/pkg/strconv/#ParseUint),
if base is 0, underscores may be used between digits for readability.
See the [Changes to the language](#language) for details.
<!-- strconv -->
[strings](/pkg/strings/)
#### [strings](/pkg/strings/)
: <!-- CL 142003 -->
The new [`ToValidUTF8`](/pkg/strings/#ToValidUTF8) function returns a
copy of a given string with each run of invalid UTF-8 byte sequences replaced by a given string.
<!-- CL 142003 -->
The new [`ToValidUTF8`](/pkg/strings/#ToValidUTF8) function returns a
copy of a given string with each run of invalid UTF-8 byte sequences replaced by a given string.
<!-- strings -->
[sync](/pkg/sync/)
#### [sync](/pkg/sync/)
: <!-- CL 148958, CL 148959, CL 152697, CL 152698 -->
The fast paths of [`Mutex.Lock`](/pkg/sync/#Mutex.Lock), [`Mutex.Unlock`](/pkg/sync/#Mutex.Unlock),
[`RWMutex.Lock`](/pkg/sync/#RWMutex.Lock), [`RWMutex.RUnlock`](/pkg/sync/#Mutex.RUnlock), and
[`Once.Do`](/pkg/sync/#Once.Do) are now inlined in their callers.
For the uncontended cases on amd64, these changes make [`Once.Do`](/pkg/sync/#Once.Do) twice as fast, and the
[`Mutex`](/pkg/sync/#Mutex)/[`RWMutex`](/pkg/sync/#RWMutex) methods up to 10% faster.
<!-- CL 148958, CL 148959, CL 152697, CL 152698 -->
The fast paths of [`Mutex.Lock`](/pkg/sync/#Mutex.Lock), [`Mutex.Unlock`](/pkg/sync/#Mutex.Unlock),
[`RWMutex.Lock`](/pkg/sync/#RWMutex.Lock), [`RWMutex.RUnlock`](/pkg/sync/#Mutex.RUnlock), and
[`Once.Do`](/pkg/sync/#Once.Do) are now inlined in their callers.
For the uncontended cases on amd64, these changes make [`Once.Do`](/pkg/sync/#Once.Do) twice as fast, and the
[`Mutex`](/pkg/sync/#Mutex)/[`RWMutex`](/pkg/sync/#RWMutex) methods up to 10% faster.
<!-- CL 166960 -->
Large [`Pool`](/pkg/sync/#Pool) no longer increase stop-the-world pause times.
<!-- CL 166960 -->
Large [`Pool`](/pkg/sync/#Pool) no longer increase stop-the-world pause times.
<!-- CL 166961 -->
`Pool` no longer needs to be completely repopulated after every GC. It now retains some objects across GCs,
as opposed to releasing all objects, reducing load spikes for heavy users of `Pool`.
<!-- CL 166961 -->
`Pool` no longer needs to be completely repopulated after every GC. It now retains some objects across GCs,
as opposed to releasing all objects, reducing load spikes for heavy users of `Pool`.
<!-- sync -->
[syscall](/pkg/syscall/)
#### [syscall](/pkg/syscall/)
: <!-- CL 168479 -->
Uses of `_getdirentries64` have been removed from
Darwin builds, to allow Go binaries to be uploaded to the macOS
App Store.
<!-- CL 168479 -->
Uses of `_getdirentries64` have been removed from
Darwin builds, to allow Go binaries to be uploaded to the macOS
App Store.
<!-- CL 174197 -->
The new `ProcessAttributes` and `ThreadAttributes` fields in
[`SysProcAttr`](/pkg/syscall/?GOOS=windows#SysProcAttr) have been introduced for Windows,
exposing security settings when creating new processes.
<!-- CL 174197 -->
The new `ProcessAttributes` and `ThreadAttributes` fields in
[`SysProcAttr`](/pkg/syscall/?GOOS=windows#SysProcAttr) have been introduced for Windows,
exposing security settings when creating new processes.
<!-- CL 174320 -->
`EINVAL` is no longer returned in zero
[`Chmod`](/pkg/syscall/?GOOS=windows#Chmod) mode on Windows.
<!-- CL 174320 -->
`EINVAL` is no longer returned in zero
[`Chmod`](/pkg/syscall/?GOOS=windows#Chmod) mode on Windows.
<!-- CL 191337 -->
Values of type `Errno` can be tested against error values in
the `os` package,
like [`ErrExist`](/pkg/os/#ErrExist), using
[`errors.Is`](/pkg/errors/#Is).
<!-- CL 191337 -->
Values of type `Errno` can be tested against error values in
the `os` package,
like [`ErrExist`](/pkg/os/#ErrExist), using
[`errors.Is`](/pkg/errors/#Is).
<!-- syscall -->
[syscall/js](/pkg/syscall/js/)
#### [syscall/js](/pkg/syscall/js/)
: <!-- CL 177537 -->
`TypedArrayOf` has been replaced by
[`CopyBytesToGo`](/pkg/syscall/js/#CopyBytesToGo) and
[`CopyBytesToJS`](/pkg/syscall/js/#CopyBytesToJS) for copying bytes
between a byte slice and a `Uint8Array`.
<!-- CL 177537 -->
`TypedArrayOf` has been replaced by
[`CopyBytesToGo`](/pkg/syscall/js/#CopyBytesToGo) and
[`CopyBytesToJS`](/pkg/syscall/js/#CopyBytesToJS) for copying bytes
between a byte slice and a `Uint8Array`.
<!-- syscall/js -->
[testing](/pkg/testing/)
#### [testing](/pkg/testing/)
: <!-- CL 112155 -->
When running benchmarks, [`B.N`](/pkg/testing/#B.N) is no longer rounded.
<!-- CL 112155 -->
When running benchmarks, [`B.N`](/pkg/testing/#B.N) is no longer rounded.
<!-- CL 166717 -->
The new method [`B.ReportMetric`](/pkg/testing/#B.ReportMetric) lets users report
custom benchmark metrics and override built-in metrics.
<!-- CL 166717 -->
The new method [`B.ReportMetric`](/pkg/testing/#B.ReportMetric) lets users report
custom benchmark metrics and override built-in metrics.
<!-- CL 173722 -->
Testing flags are now registered in the new [`Init`](/pkg/testing/#Init) function,
which is invoked by the generated `main` function for the test.
As a result, testing flags are now only registered when running a test binary,
and packages that call `flag.Parse` during package initialization may cause tests to fail.
<!-- CL 173722 -->
Testing flags are now registered in the new [`Init`](/pkg/testing/#Init) function,
which is invoked by the generated `main` function for the test.
As a result, testing flags are now only registered when running a test binary,
and packages that call `flag.Parse` during package initialization may cause tests to fail.
<!-- testing -->
[text/scanner](/pkg/text/scanner/)
#### [text/scanner](/pkg/text/scanner/)
: <!-- CL 183077 -->
The scanner has been updated to recognize the new Go number literals, specifically
binary literals with `0b`/`0B` prefix, octal literals with `0o`/`0O` prefix,
and floating-point numbers with hexadecimal mantissa.
Also, the new [`AllowDigitSeparators`](/pkg/text/scanner/#AllowDigitSeparators)
mode allows number literals to contain underscores as digit separators (off by default for backwards-compatibility).
See the [Changes to the language](#language) for details.
<!-- CL 183077 -->
The scanner has been updated to recognize the new Go number literals, specifically
binary literals with `0b`/`0B` prefix, octal literals with `0o`/`0O` prefix,
and floating-point numbers with hexadecimal mantissa.
Also, the new [`AllowDigitSeparators`](/pkg/text/scanner/#AllowDigitSeparators)
mode allows number literals to contain underscores as digit separators (off by default for backwards-compatibility).
See the [Changes to the language](#language) for details.
<!-- text/scanner -->
[text/template](/pkg/text/template/)
#### [text/template](/pkg/text/template/)
: <!-- CL 161762 -->
The new [slice function](/pkg/text/template/#hdr-Functions)
returns the result of slicing its first argument by the following arguments.
<!-- CL 161762 -->
The new [slice function](/pkg/text/template/#hdr-Functions)
returns the result of slicing its first argument by the following arguments.
<!-- text/template -->
[time](/pkg/time/)
#### [time](/pkg/time/)
: <!-- CL 122876 -->
Day-of-year is now supported by [`Format`](/pkg/time/#Time.Format)
and [`Parse`](/pkg/time/#Parse).
<!-- CL 122876 -->
Day-of-year is now supported by [`Format`](/pkg/time/#Time.Format)
and [`Parse`](/pkg/time/#Parse).
<!-- CL 167387 -->
The new [`Duration`](/pkg/time/#Duration) methods
[`Microseconds`](/pkg/time/#Duration.Microseconds) and
[`Milliseconds`](/pkg/time/#Duration.Milliseconds) return
the duration as an integer count of their respectively named units.
<!-- CL 167387 -->
The new [`Duration`](/pkg/time/#Duration) methods
[`Microseconds`](/pkg/time/#Duration.Microseconds) and
[`Milliseconds`](/pkg/time/#Duration.Milliseconds) return
the duration as an integer count of their respectively named units.
<!-- time -->
[unicode](/pkg/unicode/)
#### [unicode](/pkg/unicode/)
: The [`unicode`](/pkg/unicode/) package and associated
support throughout the system has been upgraded from Unicode 10.0 to
[Unicode 11.0](https://www.unicode.org/versions/Unicode11.0.0/),
which adds 684 new characters, including seven new scripts, and 66 new emoji.
The [`unicode`](/pkg/unicode/) package and associated
support throughout the system has been upgraded from Unicode 10.0 to
[Unicode 11.0](https://www.unicode.org/versions/Unicode11.0.0/),
which adds 684 new characters, including seven new scripts, and 66 new emoji.
<!-- unicode -->

Просмотреть файл

@ -375,433 +375,433 @@ As always, there are various minor changes and updates to the library,
made with the Go 1 [promise of compatibility](/doc/go1compat)
in mind.
[crypto/tls](/pkg/crypto/tls/)
#### [crypto/tls](/pkg/crypto/tls/)
: <!-- CL 191976 -->
Support for SSL version 3.0 (SSLv3) has been removed. Note that SSLv3 is the
[cryptographically broken](https://tools.ietf.org/html/rfc7568)
protocol predating TLS.
<!-- CL 191976 -->
Support for SSL version 3.0 (SSLv3) has been removed. Note that SSLv3 is the
[cryptographically broken](https://tools.ietf.org/html/rfc7568)
protocol predating TLS.
<!-- CL 191999 -->
TLS 1.3 can't be disabled via the `GODEBUG` environment
variable anymore. Use the
[`Config.MaxVersion`](/pkg/crypto/tls/#Config.MaxVersion)
field to configure TLS versions.
<!-- CL 191999 -->
TLS 1.3 can't be disabled via the `GODEBUG` environment
variable anymore. Use the
[`Config.MaxVersion`](/pkg/crypto/tls/#Config.MaxVersion)
field to configure TLS versions.
<!-- CL 205059 -->
When multiple certificate chains are provided through the
[`Config.Certificates`](/pkg/crypto/tls/#Config.Certificates)
field, the first one compatible with the peer is now automatically
selected. This allows for example providing an ECDSA and an RSA
certificate, and letting the package automatically select the best one.
Note that the performance of this selection is going to be poor unless the
[`Certificate.Leaf`](/pkg/crypto/tls/#Certificate.Leaf)
field is set. The
[`Config.NameToCertificate`](/pkg/crypto/tls/#Config.NameToCertificate)
field, which only supports associating a single certificate with
a give name, is now deprecated and should be left as `nil`.
Similarly the
[`Config.BuildNameToCertificate`](/pkg/crypto/tls/#Config.BuildNameToCertificate)
method, which builds the `NameToCertificate` field
from the leaf certificates, is now deprecated and should not be
called.
<!-- CL 205059 -->
When multiple certificate chains are provided through the
[`Config.Certificates`](/pkg/crypto/tls/#Config.Certificates)
field, the first one compatible with the peer is now automatically
selected. This allows for example providing an ECDSA and an RSA
certificate, and letting the package automatically select the best one.
Note that the performance of this selection is going to be poor unless the
[`Certificate.Leaf`](/pkg/crypto/tls/#Certificate.Leaf)
field is set. The
[`Config.NameToCertificate`](/pkg/crypto/tls/#Config.NameToCertificate)
field, which only supports associating a single certificate with
a give name, is now deprecated and should be left as `nil`.
Similarly the
[`Config.BuildNameToCertificate`](/pkg/crypto/tls/#Config.BuildNameToCertificate)
method, which builds the `NameToCertificate` field
from the leaf certificates, is now deprecated and should not be
called.
<!-- CL 175517 -->
The new [`CipherSuites`](/pkg/crypto/tls/#CipherSuites)
and [`InsecureCipherSuites`](/pkg/crypto/tls/#InsecureCipherSuites)
functions return a list of currently implemented cipher suites.
The new [`CipherSuiteName`](/pkg/crypto/tls/#CipherSuiteName)
function returns a name for a cipher suite ID.
<!-- CL 175517 -->
The new [`CipherSuites`](/pkg/crypto/tls/#CipherSuites)
and [`InsecureCipherSuites`](/pkg/crypto/tls/#InsecureCipherSuites)
functions return a list of currently implemented cipher suites.
The new [`CipherSuiteName`](/pkg/crypto/tls/#CipherSuiteName)
function returns a name for a cipher suite ID.
<!-- CL 205058, 205057 -->
The new [
`(*ClientHelloInfo).SupportsCertificate`](/pkg/crypto/tls/#ClientHelloInfo.SupportsCertificate) and
[
`(*CertificateRequestInfo).SupportsCertificate`](/pkg/crypto/tls/#CertificateRequestInfo.SupportsCertificate)
methods expose whether a peer supports a certain certificate.
<!-- CL 205058, 205057 -->
The new [
`(*ClientHelloInfo).SupportsCertificate`](/pkg/crypto/tls/#ClientHelloInfo.SupportsCertificate) and
[
`(*CertificateRequestInfo).SupportsCertificate`](/pkg/crypto/tls/#CertificateRequestInfo.SupportsCertificate)
methods expose whether a peer supports a certain certificate.
<!-- CL 174329 -->
The `tls` package no longer supports the legacy Next Protocol
Negotiation (NPN) extension and now only supports ALPN. In previous
releases it supported both. There are no API changes and applications
should function identically as before. Most other clients and servers have
already removed NPN support in favor of the standardized ALPN.
<!-- CL 174329 -->
The `tls` package no longer supports the legacy Next Protocol
Negotiation (NPN) extension and now only supports ALPN. In previous
releases it supported both. There are no API changes and applications
should function identically as before. Most other clients and servers have
already removed NPN support in favor of the standardized ALPN.
<!-- CL 205063, 205062 -->
RSA-PSS signatures are now used when supported in TLS 1.2 handshakes. This
won't affect most applications, but custom
[`Certificate.PrivateKey`](/pkg/crypto/tls/#Certificate.PrivateKey)
implementations that don't support RSA-PSS signatures will need to use the new
[
`Certificate.SupportedSignatureAlgorithms`](/pkg/crypto/tls/#Certificate.SupportedSignatureAlgorithms)
field to disable them.
<!-- CL 205063, 205062 -->
RSA-PSS signatures are now used when supported in TLS 1.2 handshakes. This
won't affect most applications, but custom
[`Certificate.PrivateKey`](/pkg/crypto/tls/#Certificate.PrivateKey)
implementations that don't support RSA-PSS signatures will need to use the new
[
`Certificate.SupportedSignatureAlgorithms`](/pkg/crypto/tls/#Certificate.SupportedSignatureAlgorithms)
field to disable them.
<!-- CL 205059, 205059 -->
[`Config.Certificates`](/pkg/crypto/tls/#Config.Certificates) and
[`Config.GetCertificate`](/pkg/crypto/tls/#Config.GetCertificate)
can now both be nil if
[`Config.GetConfigForClient`](/pkg/crypto/tls/#Config.GetConfigForClient)
is set. If the callbacks return neither certificates nor an error, the
`unrecognized_name` is now sent.
<!-- CL 205059, 205059 -->
[`Config.Certificates`](/pkg/crypto/tls/#Config.Certificates) and
[`Config.GetCertificate`](/pkg/crypto/tls/#Config.GetCertificate)
can now both be nil if
[`Config.GetConfigForClient`](/pkg/crypto/tls/#Config.GetConfigForClient)
is set. If the callbacks return neither certificates nor an error, the
`unrecognized_name` is now sent.
<!-- CL 205058 -->
The new [`CertificateRequestInfo.Version`](/pkg/crypto/tls/#CertificateRequestInfo.Version)
field provides the TLS version to client certificates callbacks.
<!-- CL 205058 -->
The new [`CertificateRequestInfo.Version`](/pkg/crypto/tls/#CertificateRequestInfo.Version)
field provides the TLS version to client certificates callbacks.
<!-- CL 205068 -->
The new `TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256` and
`TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256` constants use
the final names for the cipher suites previously referred to as
`TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305` and
`TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305`.
<!-- CL 205068 -->
The new `TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256` and
`TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256` constants use
the final names for the cipher suites previously referred to as
`TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305` and
`TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305`.
<!-- crypto/tls -->
[crypto/x509](/pkg/crypto/x509/)
#### [crypto/x509](/pkg/crypto/x509/)
: <!-- CL 204046 -->
[`Certificate.CreateCRL`](/pkg/crypto/x509/#Certificate.CreateCRL)
now supports Ed25519 issuers.
<!-- CL 204046 -->
[`Certificate.CreateCRL`](/pkg/crypto/x509/#Certificate.CreateCRL)
now supports Ed25519 issuers.
[debug/dwarf](/pkg/debug/dwarf/)
#### [debug/dwarf](/pkg/debug/dwarf/)
: <!-- CL 175138 -->
The `debug/dwarf` package now supports reading DWARF
version 5.
<!-- CL 175138 -->
The `debug/dwarf` package now supports reading DWARF
version 5.
The new
method [`(*Data).AddSection`](/pkg/debug/dwarf/#Data.AddSection)
supports adding arbitrary new DWARF sections from the input file
to the DWARF `Data`.
The new
method [`(*Data).AddSection`](/pkg/debug/dwarf/#Data.AddSection)
supports adding arbitrary new DWARF sections from the input file
to the DWARF `Data`.
<!-- CL 192698 -->
The new
method [`(*Reader).ByteOrder`](/pkg/debug/dwarf/#Reader.ByteOrder)
returns the byte order of the current compilation unit.
This may be used to interpret attributes that are encoded in the
native ordering, such as location descriptions.
<!-- CL 192698 -->
The new
method [`(*Reader).ByteOrder`](/pkg/debug/dwarf/#Reader.ByteOrder)
returns the byte order of the current compilation unit.
This may be used to interpret attributes that are encoded in the
native ordering, such as location descriptions.
<!-- CL 192699 -->
The new
method [`(*LineReader).Files`](/pkg/debug/dwarf/#LineReader.Files)
returns the file name table from a line reader.
This may be used to interpret the value of DWARF attributes such
as `AttrDeclFile`.
<!-- CL 192699 -->
The new
method [`(*LineReader).Files`](/pkg/debug/dwarf/#LineReader.Files)
returns the file name table from a line reader.
This may be used to interpret the value of DWARF attributes such
as `AttrDeclFile`.
<!-- debug/dwarf -->
[encoding/asn1](/pkg/encoding/asn1/)
#### [encoding/asn1](/pkg/encoding/asn1/)
: <!-- CL 126624 -->
[`Unmarshal`](/pkg/encoding/asn1/#Unmarshal)
now supports ASN.1 string type BMPString, represented by the new
[`TagBMPString`](/pkg/encoding/asn1/#TagBMPString)
constant.
<!-- CL 126624 -->
[`Unmarshal`](/pkg/encoding/asn1/#Unmarshal)
now supports ASN.1 string type BMPString, represented by the new
[`TagBMPString`](/pkg/encoding/asn1/#TagBMPString)
constant.
<!-- encoding/asn1 -->
[encoding/json](/pkg/encoding/json/)
#### [encoding/json](/pkg/encoding/json/)
: <!-- CL 200677 -->
The [`Decoder`](/pkg/encoding/json/#Decoder)
type supports a new
method [`InputOffset`](/pkg/encoding/json/#Decoder.InputOffset)
that returns the input stream byte offset of the current
decoder position.
<!-- CL 200677 -->
The [`Decoder`](/pkg/encoding/json/#Decoder)
type supports a new
method [`InputOffset`](/pkg/encoding/json/#Decoder.InputOffset)
that returns the input stream byte offset of the current
decoder position.
<!-- CL 200217 -->
[`Compact`](/pkg/encoding/json/#Compact) no longer
escapes the `U+2028` and `U+2029` characters, which
was never a documented feature. For proper escaping, see [`HTMLEscape`](/pkg/encoding/json/#HTMLEscape).
<!-- CL 200217 -->
[`Compact`](/pkg/encoding/json/#Compact) no longer
escapes the `U+2028` and `U+2029` characters, which
was never a documented feature. For proper escaping, see [`HTMLEscape`](/pkg/encoding/json/#HTMLEscape).
<!-- CL 195045 -->
[`Number`](/pkg/encoding/json/#Number) no longer
accepts invalid numbers, to follow the documented behavior more closely.
If a program needs to accept invalid numbers like the empty string,
consider wrapping the type with [`Unmarshaler`](/pkg/encoding/json/#Unmarshaler).
<!-- CL 195045 -->
[`Number`](/pkg/encoding/json/#Number) no longer
accepts invalid numbers, to follow the documented behavior more closely.
If a program needs to accept invalid numbers like the empty string,
consider wrapping the type with [`Unmarshaler`](/pkg/encoding/json/#Unmarshaler).
<!-- CL 200237 -->
[`Unmarshal`](/pkg/encoding/json/#Unmarshal)
can now support map keys with string underlying type which implement
[`encoding.TextUnmarshaler`](/pkg/encoding/#TextUnmarshaler).
<!-- CL 200237 -->
[`Unmarshal`](/pkg/encoding/json/#Unmarshal)
can now support map keys with string underlying type which implement
[`encoding.TextUnmarshaler`](/pkg/encoding/#TextUnmarshaler).
<!-- encoding/json -->
[go/build](/pkg/go/build/)
#### [go/build](/pkg/go/build/)
: <!-- CL 203820, 211657 -->
The [`Context`](/pkg/go/build/#Context)
type has a new field `Dir` which may be used to set
the working directory for the build.
The default is the current directory of the running process.
In module mode, this is used to locate the main module.
<!-- CL 203820, 211657 -->
The [`Context`](/pkg/go/build/#Context)
type has a new field `Dir` which may be used to set
the working directory for the build.
The default is the current directory of the running process.
In module mode, this is used to locate the main module.
<!-- go/build -->
[go/doc](/pkg/go/doc/)
#### [go/doc](/pkg/go/doc/)
: <!-- CL 204830 -->
The new
function [`NewFromFiles`](/pkg/go/doc/#NewFromFiles)
computes package documentation from a list
of `*ast.File`'s and associates examples with the
appropriate package elements.
The new information is available in a new `Examples`
field
in the [`Package`](/pkg/go/doc/#Package), [`Type`](/pkg/go/doc/#Type),
and [`Func`](/pkg/go/doc/#Func) types, and a
new [`Suffix`](/pkg/go/doc/#Example.Suffix)
field in
the [`Example`](/pkg/go/doc/#Example)
type.
<!-- CL 204830 -->
The new
function [`NewFromFiles`](/pkg/go/doc/#NewFromFiles)
computes package documentation from a list
of `*ast.File`'s and associates examples with the
appropriate package elements.
The new information is available in a new `Examples`
field
in the [`Package`](/pkg/go/doc/#Package), [`Type`](/pkg/go/doc/#Type),
and [`Func`](/pkg/go/doc/#Func) types, and a
new [`Suffix`](/pkg/go/doc/#Example.Suffix)
field in
the [`Example`](/pkg/go/doc/#Example)
type.
<!-- go/doc -->
[io/ioutil](/pkg/io/ioutil/)
#### [io/ioutil](/pkg/io/ioutil/)
: <!-- CL 198488 -->
[`TempDir`](/pkg/io/ioutil/#TempDir) can now create directories
whose names have predictable prefixes and suffixes.
As with [`TempFile`](/pkg/io/ioutil/#TempFile), if the pattern
contains a '\*', the random string replaces the last '\*'.
<!-- CL 198488 -->
[`TempDir`](/pkg/io/ioutil/#TempDir) can now create directories
whose names have predictable prefixes and suffixes.
As with [`TempFile`](/pkg/io/ioutil/#TempFile), if the pattern
contains a '\*', the random string replaces the last '\*'.
[log](/pkg/log/)
#### [log](/pkg/log/)
: <!-- CL 186182 -->
The
new [`Lmsgprefix`](https://tip.golang.org/pkg/log/#pkg-constants)
flag may be used to tell the logging functions to emit the
optional output prefix immediately before the log message rather
than at the start of the line.
<!-- CL 186182 -->
The
new [`Lmsgprefix`](https://tip.golang.org/pkg/log/#pkg-constants)
flag may be used to tell the logging functions to emit the
optional output prefix immediately before the log message rather
than at the start of the line.
<!-- log -->
[math](/pkg/math/)
#### [math](/pkg/math/)
: <!-- CL 127458 -->
The new [`FMA`](/pkg/math/#FMA) function
computes `x*y+z` in floating point with no
intermediate rounding of the `x*y`
computation. Several architectures implement this computation
using dedicated hardware instructions for additional performance.
<!-- CL 127458 -->
The new [`FMA`](/pkg/math/#FMA) function
computes `x*y+z` in floating point with no
intermediate rounding of the `x*y`
computation. Several architectures implement this computation
using dedicated hardware instructions for additional performance.
<!-- math -->
[math/big](/pkg/math/big/)
#### [math/big](/pkg/math/big/)
: <!-- CL 164972 -->
The [`GCD`](/pkg/math/big/#Int.GCD) method
now allows the inputs `a` and `b` to be
zero or negative.
<!-- CL 164972 -->
The [`GCD`](/pkg/math/big/#Int.GCD) method
now allows the inputs `a` and `b` to be
zero or negative.
<!-- math/big -->
[math/bits](/pkg/math/bits/)
#### [math/bits](/pkg/math/bits/)
: <!-- CL 197838 -->
The new functions
[`Rem`](/pkg/math/bits/#Rem),
[`Rem32`](/pkg/math/bits/#Rem32), and
[`Rem64`](/pkg/math/bits/#Rem64)
support computing a remainder even when the quotient overflows.
<!-- CL 197838 -->
The new functions
[`Rem`](/pkg/math/bits/#Rem),
[`Rem32`](/pkg/math/bits/#Rem32), and
[`Rem64`](/pkg/math/bits/#Rem64)
support computing a remainder even when the quotient overflows.
<!-- math/bits -->
[mime](/pkg/mime/)
#### [mime](/pkg/mime/)
: <!-- CL 186927 -->
The default type of `.js` and `.mjs` files
is now `text/javascript` rather
than `application/javascript`.
This is in accordance
with [an
IETF draft](https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/) that treats `application/javascript` as obsolete.
<!-- CL 186927 -->
The default type of `.js` and `.mjs` files
is now `text/javascript` rather
than `application/javascript`.
This is in accordance
with [an
IETF draft](https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/) that treats `application/javascript` as obsolete.
<!-- mime -->
[mime/multipart](/pkg/mime/multipart/)
#### [mime/multipart](/pkg/mime/multipart/)
: The
new [`Reader`](/pkg/mime/multipart/#Reader)
method [`NextRawPart`](/pkg/mime/multipart/#Reader.NextRawPart)
supports fetching the next MIME part without transparently
decoding `quoted-printable` data.
The
new [`Reader`](/pkg/mime/multipart/#Reader)
method [`NextRawPart`](/pkg/mime/multipart/#Reader.NextRawPart)
supports fetching the next MIME part without transparently
decoding `quoted-printable` data.
<!-- mime/multipart -->
[net/http](/pkg/net/http/)
#### [net/http](/pkg/net/http/)
: <!-- CL 200760 -->
The new [`Header`](/pkg/net/http/#Header)
method [`Values`](/pkg/net/http/#Header.Values)
can be used to fetch all values associated with a
canonicalized key.
<!-- CL 200760 -->
The new [`Header`](/pkg/net/http/#Header)
method [`Values`](/pkg/net/http/#Header.Values)
can be used to fetch all values associated with a
canonicalized key.
<!-- CL 61291 -->
The
new [`Transport`](/pkg/net/http/#Transport)
field [`DialTLSContext`](/pkg/net/http/#Transport.DialTLSContext)
can be used to specify an optional dial function for creating
TLS connections for non-proxied HTTPS requests.
This new field can be used instead
of [`DialTLS`](/pkg/net/http/#Transport.DialTLS),
which is now considered deprecated; `DialTLS` will
continue to work, but new code should
use `DialTLSContext`, which allows the transport to
cancel dials as soon as they are no longer needed.
<!-- CL 61291 -->
The
new [`Transport`](/pkg/net/http/#Transport)
field [`DialTLSContext`](/pkg/net/http/#Transport.DialTLSContext)
can be used to specify an optional dial function for creating
TLS connections for non-proxied HTTPS requests.
This new field can be used instead
of [`DialTLS`](/pkg/net/http/#Transport.DialTLS),
which is now considered deprecated; `DialTLS` will
continue to work, but new code should
use `DialTLSContext`, which allows the transport to
cancel dials as soon as they are no longer needed.
<!-- CL 192518, CL 194218 -->
On Windows, [`ServeFile`](/pkg/net/http/#ServeFile) now correctly
serves files larger than 2GB.
<!-- CL 192518, CL 194218 -->
On Windows, [`ServeFile`](/pkg/net/http/#ServeFile) now correctly
serves files larger than 2GB.
<!-- net/http -->
[net/http/httptest](/pkg/net/http/httptest/)
#### [net/http/httptest](/pkg/net/http/httptest/)
: <!-- CL 201557 -->
The
new [`Server`](/pkg/net/http/httptest/#Server)
field [`EnableHTTP2`](/pkg/net/http/httptest/#Server.EnableHTTP2)
supports enabling HTTP/2 on the test server.
<!-- CL 201557 -->
The
new [`Server`](/pkg/net/http/httptest/#Server)
field [`EnableHTTP2`](/pkg/net/http/httptest/#Server.EnableHTTP2)
supports enabling HTTP/2 on the test server.
<!-- net/http/httptest -->
[net/textproto](/pkg/net/textproto/)
#### [net/textproto](/pkg/net/textproto/)
: <!-- CL 200760 -->
The
new [`MIMEHeader`](/pkg/net/textproto/#MIMEHeader)
method [`Values`](/pkg/net/textproto/#MIMEHeader.Values)
can be used to fetch all values associated with a canonicalized
key.
<!-- CL 200760 -->
The
new [`MIMEHeader`](/pkg/net/textproto/#MIMEHeader)
method [`Values`](/pkg/net/textproto/#MIMEHeader.Values)
can be used to fetch all values associated with a canonicalized
key.
<!-- net/textproto -->
[net/url](/pkg/net/url/)
#### [net/url](/pkg/net/url/)
: <!-- CL 185117 -->
When parsing of a URL fails
(for example by [`Parse`](/pkg/net/url/#Parse)
or [`ParseRequestURI`](/pkg/net/url/#ParseRequestURI)),
the resulting [`Error`](/pkg/net/url/#Error.Error) message
will now quote the unparsable URL.
This provides clearer structure and consistency with other parsing errors.
<!-- CL 185117 -->
When parsing of a URL fails
(for example by [`Parse`](/pkg/net/url/#Parse)
or [`ParseRequestURI`](/pkg/net/url/#ParseRequestURI)),
the resulting [`Error`](/pkg/net/url/#Error.Error) message
will now quote the unparsable URL.
This provides clearer structure and consistency with other parsing errors.
<!-- net/url -->
[os/signal](/pkg/os/signal/)
#### [os/signal](/pkg/os/signal/)
: <!-- CL 187739 -->
On Windows,
the `CTRL_CLOSE_EVENT`, `CTRL_LOGOFF_EVENT`,
and `CTRL_SHUTDOWN_EVENT` events now generate
a `syscall.SIGTERM` signal, similar to how Control-C
and Control-Break generate a `syscall.SIGINT` signal.
<!-- CL 187739 -->
On Windows,
the `CTRL_CLOSE_EVENT`, `CTRL_LOGOFF_EVENT`,
and `CTRL_SHUTDOWN_EVENT` events now generate
a `syscall.SIGTERM` signal, similar to how Control-C
and Control-Break generate a `syscall.SIGINT` signal.
<!-- os/signal -->
[plugin](/pkg/plugin/)
#### [plugin](/pkg/plugin/)
: <!-- CL 191617 -->
The `plugin` package now supports `freebsd/amd64`.
<!-- CL 191617 -->
The `plugin` package now supports `freebsd/amd64`.
<!-- plugin -->
[reflect](/pkg/reflect/)
#### [reflect](/pkg/reflect/)
: <!-- CL 85661 -->
[`StructOf`](/pkg/reflect#StructOf) now
supports creating struct types with unexported fields, by
setting the `PkgPath` field in
a `StructField` element.
<!-- CL 85661 -->
[`StructOf`](/pkg/reflect#StructOf) now
supports creating struct types with unexported fields, by
setting the `PkgPath` field in
a `StructField` element.
<!-- reflect -->
[runtime](/pkg/runtime/)
#### [runtime](/pkg/runtime/)
: <!-- CL 200081 -->
`runtime.Goexit` can no longer be aborted by a
recursive `panic`/`recover`.
<!-- CL 200081 -->
`runtime.Goexit` can no longer be aborted by a
recursive `panic`/`recover`.
<!-- CL 188297, CL 191785 -->
On macOS, `SIGPIPE` is no longer forwarded to signal
handlers installed before the Go runtime is initialized.
This is necessary because macOS delivers `SIGPIPE`
[to the main thread](/issue/33384)
rather than the thread writing to the closed pipe.
<!-- CL 188297, CL 191785 -->
On macOS, `SIGPIPE` is no longer forwarded to signal
handlers installed before the Go runtime is initialized.
This is necessary because macOS delivers `SIGPIPE`
[to the main thread](/issue/33384)
rather than the thread writing to the closed pipe.
<!-- runtime -->
[runtime/pprof](/pkg/runtime/pprof/)
#### [runtime/pprof](/pkg/runtime/pprof/)
: <!-- CL 204636, 205097 -->
The generated profile no longer includes the pseudo-PCs used for inline
marks. Symbol information of inlined functions is encoded in
[the format](https://github.com/google/pprof/blob/5e96527/proto/profile.proto#L177-L184)
the pprof tool expects. This is a fix for the regression introduced
during recent releases.
<!-- CL 204636, 205097 -->
The generated profile no longer includes the pseudo-PCs used for inline
marks. Symbol information of inlined functions is encoded in
[the format](https://github.com/google/pprof/blob/5e96527/proto/profile.proto#L177-L184)
the pprof tool expects. This is a fix for the regression introduced
during recent releases.
<!-- runtime/pprof -->
[strconv](/pkg/strconv/)
#### [strconv](/pkg/strconv/)
: The [`NumError`](/pkg/strconv/#NumError)
type now has
an [`Unwrap`](/pkg/strconv/#NumError.Unwrap)
method that may be used to retrieve the reason that a conversion
failed.
This supports using `NumError` values
with [`errors.Is`](/pkg/errors/#Is) to see
if the underlying error
is [`strconv.ErrRange`](/pkg/strconv/#pkg-variables)
or [`strconv.ErrSyntax`](/pkg/strconv/#pkg-variables).
The [`NumError`](/pkg/strconv/#NumError)
type now has
an [`Unwrap`](/pkg/strconv/#NumError.Unwrap)
method that may be used to retrieve the reason that a conversion
failed.
This supports using `NumError` values
with [`errors.Is`](/pkg/errors/#Is) to see
if the underlying error
is [`strconv.ErrRange`](/pkg/strconv/#pkg-variables)
or [`strconv.ErrSyntax`](/pkg/strconv/#pkg-variables).
<!-- strconv -->
[sync](/pkg/sync/)
#### [sync](/pkg/sync/)
: <!-- CL 200577 -->
Unlocking a highly contended `Mutex` now directly
yields the CPU to the next goroutine waiting for
that `Mutex`. This significantly improves the
performance of highly contended mutexes on high CPU count
machines.
<!-- CL 200577 -->
Unlocking a highly contended `Mutex` now directly
yields the CPU to the next goroutine waiting for
that `Mutex`. This significantly improves the
performance of highly contended mutexes on high CPU count
machines.
<!-- sync -->
[testing](/pkg/testing/)
#### [testing](/pkg/testing/)
: <!-- CL 201359 -->
The testing package now supports cleanup functions, called after
a test or benchmark has finished, by calling
[`T.Cleanup`](/pkg/testing#T.Cleanup) or
[`B.Cleanup`](/pkg/testing#B.Cleanup) respectively.
<!-- CL 201359 -->
The testing package now supports cleanup functions, called after
a test or benchmark has finished, by calling
[`T.Cleanup`](/pkg/testing#T.Cleanup) or
[`B.Cleanup`](/pkg/testing#B.Cleanup) respectively.
<!-- testing -->
[text/template](/pkg/text/template/)
#### [text/template](/pkg/text/template/)
: <!-- CL 206124 -->
The text/template package now correctly reports errors when a
parenthesized argument is used as a function.
This most commonly shows up in erroneous cases like
`{{if (eq .F "a") or (eq .F "b")}}`.
This should be written as `{{if or (eq .F "a") (eq .F "b")}}`.
The erroneous case never worked as expected, and will now be
reported with an error `can't give argument to non-function`.
<!-- CL 206124 -->
The text/template package now correctly reports errors when a
parenthesized argument is used as a function.
This most commonly shows up in erroneous cases like
`{{if (eq .F "a") or (eq .F "b")}}`.
This should be written as `{{if or (eq .F "a") (eq .F "b")}}`.
The erroneous case never worked as expected, and will now be
reported with an error `can't give argument to non-function`.
<!-- CL 207637 -->
[`JSEscape`](/pkg/text/template/#JSEscape) now
escapes the `&` and `=` characters to
mitigate the impact of its output being misused in HTML contexts.
<!-- CL 207637 -->
[`JSEscape`](/pkg/text/template/#JSEscape) now
escapes the `&` and `=` characters to
mitigate the impact of its output being misused in HTML contexts.
<!-- text/template -->
[unicode](/pkg/unicode/)
#### [unicode](/pkg/unicode/)
: The [`unicode`](/pkg/unicode/) package and associated
support throughout the system has been upgraded from Unicode 11.0 to
[Unicode 12.0](https://www.unicode.org/versions/Unicode12.0.0/),
which adds 554 new characters, including four new scripts, and 61 new emoji.
The [`unicode`](/pkg/unicode/) package and associated
support throughout the system has been upgraded from Unicode 11.0 to
[Unicode 12.0](https://www.unicode.org/versions/Unicode12.0.0/),
which adds 554 new characters, including four new scripts, and 61 new emoji.
<!-- unicode -->

Просмотреть файл

@ -371,541 +371,541 @@ As always, there are various minor changes and updates to the library,
made with the Go 1 [promise of compatibility](/doc/go1compat)
in mind.
[bufio](/pkg/bufio/)
#### [bufio](/pkg/bufio/)
: <!-- CL 225357, CL 225557 -->
When a [`Scanner`](/pkg/bufio/#Scanner) is
used with an invalid
[`io.Reader`](/pkg/io/#Reader) that
incorrectly returns a negative number from `Read`,
the `Scanner` will no longer panic, but will instead
return the new error
[`ErrBadReadCount`](/pkg/bufio/#ErrBadReadCount).
<!-- CL 225357, CL 225557 -->
When a [`Scanner`](/pkg/bufio/#Scanner) is
used with an invalid
[`io.Reader`](/pkg/io/#Reader) that
incorrectly returns a negative number from `Read`,
the `Scanner` will no longer panic, but will instead
return the new error
[`ErrBadReadCount`](/pkg/bufio/#ErrBadReadCount).
<!-- bufio -->
[context](/pkg/context/)
#### [context](/pkg/context/)
: <!-- CL 223777 -->
Creating a derived `Context` using a nil parent is now explicitly
disallowed. Any attempt to do so with the
[`WithValue`](/pkg/context/#WithValue),
[`WithDeadline`](/pkg/context/#WithDeadline), or
[`WithCancel`](/pkg/context/#WithCancel) functions
will cause a panic.
<!-- CL 223777 -->
Creating a derived `Context` using a nil parent is now explicitly
disallowed. Any attempt to do so with the
[`WithValue`](/pkg/context/#WithValue),
[`WithDeadline`](/pkg/context/#WithDeadline), or
[`WithCancel`](/pkg/context/#WithCancel) functions
will cause a panic.
<!-- context -->
[crypto](/pkg/crypto/)
#### [crypto](/pkg/crypto/)
: <!-- CL 231417, CL 225460 -->
The `PrivateKey` and `PublicKey` types in the
[`crypto/rsa`](/pkg/crypto/rsa/),
[`crypto/ecdsa`](/pkg/crypto/ecdsa/), and
[`crypto/ed25519`](/pkg/crypto/ed25519/) packages
now have an `Equal` method to compare keys for equivalence
or to make type-safe interfaces for public keys. The method signature
is compatible with
[`go-cmp`'s
definition of equality](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal).
<!-- CL 231417, CL 225460 -->
The `PrivateKey` and `PublicKey` types in the
[`crypto/rsa`](/pkg/crypto/rsa/),
[`crypto/ecdsa`](/pkg/crypto/ecdsa/), and
[`crypto/ed25519`](/pkg/crypto/ed25519/) packages
now have an `Equal` method to compare keys for equivalence
or to make type-safe interfaces for public keys. The method signature
is compatible with
[`go-cmp`'s
definition of equality](https://pkg.go.dev/github.com/google/go-cmp/cmp#Equal).
<!-- CL 224937 -->
[`Hash`](/pkg/crypto/#Hash) now implements
[`fmt.Stringer`](/pkg/fmt/#Stringer).
<!-- CL 224937 -->
[`Hash`](/pkg/crypto/#Hash) now implements
[`fmt.Stringer`](/pkg/fmt/#Stringer).
<!-- crypto -->
[crypto/ecdsa](/pkg/crypto/ecdsa/)
#### [crypto/ecdsa](/pkg/crypto/ecdsa/)
: <!-- CL 217940 -->
The new [`SignASN1`](/pkg/crypto/ecdsa/#SignASN1)
and [`VerifyASN1`](/pkg/crypto/ecdsa/#VerifyASN1)
functions allow generating and verifying ECDSA signatures in the standard
ASN.1 DER encoding.
<!-- CL 217940 -->
The new [`SignASN1`](/pkg/crypto/ecdsa/#SignASN1)
and [`VerifyASN1`](/pkg/crypto/ecdsa/#VerifyASN1)
functions allow generating and verifying ECDSA signatures in the standard
ASN.1 DER encoding.
<!-- crypto/ecdsa -->
[crypto/elliptic](/pkg/crypto/elliptic/)
#### [crypto/elliptic](/pkg/crypto/elliptic/)
: <!-- CL 202819 -->
The new [`MarshalCompressed`](/pkg/crypto/elliptic/#MarshalCompressed)
and [`UnmarshalCompressed`](/pkg/crypto/elliptic/#UnmarshalCompressed)
functions allow encoding and decoding NIST elliptic curve points in compressed format.
<!-- CL 202819 -->
The new [`MarshalCompressed`](/pkg/crypto/elliptic/#MarshalCompressed)
and [`UnmarshalCompressed`](/pkg/crypto/elliptic/#UnmarshalCompressed)
functions allow encoding and decoding NIST elliptic curve points in compressed format.
<!-- crypto/elliptic -->
[crypto/rsa](/pkg/crypto/rsa/)
#### [crypto/rsa](/pkg/crypto/rsa/)
: <!-- CL 226203 -->
[`VerifyPKCS1v15`](/pkg/crypto/rsa/#VerifyPKCS1v15)
now rejects invalid short signatures with missing leading zeroes, according to RFC 8017.
<!-- CL 226203 -->
[`VerifyPKCS1v15`](/pkg/crypto/rsa/#VerifyPKCS1v15)
now rejects invalid short signatures with missing leading zeroes, according to RFC 8017.
<!-- crypto/rsa -->
[crypto/tls](/pkg/crypto/tls/)
#### [crypto/tls](/pkg/crypto/tls/)
: <!-- CL 214977 -->
The new
[`Dialer`](/pkg/crypto/tls/#Dialer)
type and its
[`DialContext`](/pkg/crypto/tls/#Dialer.DialContext)
method permit using a context to both connect and handshake with a TLS server.
<!-- CL 214977 -->
The new
[`Dialer`](/pkg/crypto/tls/#Dialer)
type and its
[`DialContext`](/pkg/crypto/tls/#Dialer.DialContext)
method permit using a context to both connect and handshake with a TLS server.
<!-- CL 229122 -->
The new
[`VerifyConnection`](/pkg/crypto/tls/#Config.VerifyConnection)
callback on the [`Config`](/pkg/crypto/tls/#Config) type
allows custom verification logic for every connection. It has access to the
[`ConnectionState`](/pkg/crypto/tls/#ConnectionState)
which includes peer certificates, SCTs, and stapled OCSP responses.
<!-- CL 229122 -->
The new
[`VerifyConnection`](/pkg/crypto/tls/#Config.VerifyConnection)
callback on the [`Config`](/pkg/crypto/tls/#Config) type
allows custom verification logic for every connection. It has access to the
[`ConnectionState`](/pkg/crypto/tls/#ConnectionState)
which includes peer certificates, SCTs, and stapled OCSP responses.
<!-- CL 230679 -->
Auto-generated session ticket keys are now automatically rotated every 24 hours,
with a lifetime of 7 days, to limit their impact on forward secrecy.
<!-- CL 230679 -->
Auto-generated session ticket keys are now automatically rotated every 24 hours,
with a lifetime of 7 days, to limit their impact on forward secrecy.
<!-- CL 231317 -->
Session ticket lifetimes in TLS 1.2 and earlier, where the session keys
are reused for resumed connections, are now limited to 7 days, also to
limit their impact on forward secrecy.
<!-- CL 231317 -->
Session ticket lifetimes in TLS 1.2 and earlier, where the session keys
are reused for resumed connections, are now limited to 7 days, also to
limit their impact on forward secrecy.
<!-- CL 231038 -->
The client-side downgrade protection checks specified in RFC 8446 are now
enforced. This has the potential to cause connection errors for clients
encountering middleboxes that behave like unauthorized downgrade attacks.
<!-- CL 231038 -->
The client-side downgrade protection checks specified in RFC 8446 are now
enforced. This has the potential to cause connection errors for clients
encountering middleboxes that behave like unauthorized downgrade attacks.
<!-- CL 208226 -->
[`SignatureScheme`](/pkg/crypto/tls/#SignatureScheme),
[`CurveID`](/pkg/crypto/tls/#CurveID), and
[`ClientAuthType`](/pkg/crypto/tls/#ClientAuthType)
now implement [`fmt.Stringer`](/pkg/fmt/#Stringer).
<!-- CL 208226 -->
[`SignatureScheme`](/pkg/crypto/tls/#SignatureScheme),
[`CurveID`](/pkg/crypto/tls/#CurveID), and
[`ClientAuthType`](/pkg/crypto/tls/#ClientAuthType)
now implement [`fmt.Stringer`](/pkg/fmt/#Stringer).
<!-- CL 236737 -->
The [`ConnectionState`](/pkg/crypto/tls/#ConnectionState)
fields `OCSPResponse` and `SignedCertificateTimestamps`
are now repopulated on client-side resumed connections.
<!-- CL 236737 -->
The [`ConnectionState`](/pkg/crypto/tls/#ConnectionState)
fields `OCSPResponse` and `SignedCertificateTimestamps`
are now repopulated on client-side resumed connections.
<!-- CL 227840 -->
[`tls.Conn`](/pkg/crypto/tls/#Conn)
now returns an opaque error on permanently broken connections, wrapping
the temporary
[`net.Error`](/pkg/net/http/#Error). To access the
original `net.Error`, use
[`errors.As`](/pkg/errors/#As) (or
[`errors.Unwrap`](/pkg/errors/#Unwrap)) instead of a
type assertion.
<!-- CL 227840 -->
[`tls.Conn`](/pkg/crypto/tls/#Conn)
now returns an opaque error on permanently broken connections, wrapping
the temporary
[`net.Error`](/pkg/net/http/#Error). To access the
original `net.Error`, use
[`errors.As`](/pkg/errors/#As) (or
[`errors.Unwrap`](/pkg/errors/#Unwrap)) instead of a
type assertion.
<!-- crypto/tls -->
[crypto/x509](/pkg/crypto/x509/)
#### [crypto/x509](/pkg/crypto/x509/)
: <!-- CL 231378, CL 231380, CL 231381 -->
If either the name on the certificate or the name being verified (with
[`VerifyOptions.DNSName`](/pkg/crypto/x509/#VerifyOptions.DNSName)
or [`VerifyHostname`](/pkg/crypto/x509/#Certificate.VerifyHostname))
are invalid, they will now be compared case-insensitively without further
processing (without honoring wildcards or stripping trailing dots).
Invalid names include those with any characters other than letters,
digits, hyphens and underscores, those with empty labels, and names on
certificates with trailing dots.
<!-- CL 231378, CL 231380, CL 231381 -->
If either the name on the certificate or the name being verified (with
[`VerifyOptions.DNSName`](/pkg/crypto/x509/#VerifyOptions.DNSName)
or [`VerifyHostname`](/pkg/crypto/x509/#Certificate.VerifyHostname))
are invalid, they will now be compared case-insensitively without further
processing (without honoring wildcards or stripping trailing dots).
Invalid names include those with any characters other than letters,
digits, hyphens and underscores, those with empty labels, and names on
certificates with trailing dots.
<!-- CL 217298 -->
The new [`CreateRevocationList`](/pkg/crypto/x509/#CreateRevocationList)
function and [`RevocationList`](/pkg/crypto/x509/#RevocationList) type
allow creating RFC 5280-compliant X.509 v2 Certificate Revocation Lists.
<!-- CL 217298 -->
The new [`CreateRevocationList`](/pkg/crypto/x509/#CreateRevocationList)
function and [`RevocationList`](/pkg/crypto/x509/#RevocationList) type
allow creating RFC 5280-compliant X.509 v2 Certificate Revocation Lists.
<!-- CL 227098 -->
[`CreateCertificate`](/pkg/crypto/x509/#CreateCertificate)
now automatically generates the `SubjectKeyId` if the template
is a CA and doesn't explicitly specify one.
<!-- CL 227098 -->
[`CreateCertificate`](/pkg/crypto/x509/#CreateCertificate)
now automatically generates the `SubjectKeyId` if the template
is a CA and doesn't explicitly specify one.
<!-- CL 228777 -->
[`CreateCertificate`](/pkg/crypto/x509/#CreateCertificate)
now returns an error if the template specifies `MaxPathLen` but is not a CA.
<!-- CL 228777 -->
[`CreateCertificate`](/pkg/crypto/x509/#CreateCertificate)
now returns an error if the template specifies `MaxPathLen` but is not a CA.
<!-- CL 205237 -->
On Unix systems other than macOS, the `SSL_CERT_DIR`
environment variable can now be a colon-separated list.
<!-- CL 205237 -->
On Unix systems other than macOS, the `SSL_CERT_DIR`
environment variable can now be a colon-separated list.
<!-- CL 227037 -->
On macOS, binaries are now always linked against
`Security.framework` to extract the system trust roots,
regardless of whether cgo is available. The resulting behavior should be
more consistent with the OS verifier.
<!-- CL 227037 -->
On macOS, binaries are now always linked against
`Security.framework` to extract the system trust roots,
regardless of whether cgo is available. The resulting behavior should be
more consistent with the OS verifier.
<!-- crypto/x509 -->
[crypto/x509/pkix](/pkg/crypto/x509/pkix/)
#### [crypto/x509/pkix](/pkg/crypto/x509/pkix/)
: <!-- CL 229864, CL 240543 -->
[`Name.String`](/pkg/crypto/x509/pkix/#Name.String)
now prints non-standard attributes from
[`Names`](/pkg/crypto/x509/pkix/#Name.Names) if
[`ExtraNames`](/pkg/crypto/x509/pkix/#Name.ExtraNames) is nil.
<!-- CL 229864, CL 240543 -->
[`Name.String`](/pkg/crypto/x509/pkix/#Name.String)
now prints non-standard attributes from
[`Names`](/pkg/crypto/x509/pkix/#Name.Names) if
[`ExtraNames`](/pkg/crypto/x509/pkix/#Name.ExtraNames) is nil.
<!-- crypto/x509/pkix -->
[database/sql](/pkg/database/sql/)
#### [database/sql](/pkg/database/sql/)
: <!-- CL 145758 -->
The new [`DB.SetConnMaxIdleTime`](/pkg/database/sql/#DB.SetConnMaxIdleTime)
method allows removing a connection from the connection pool after
it has been idle for a period of time, without regard to the total
lifespan of the connection. The [`DBStats.MaxIdleTimeClosed`](/pkg/database/sql/#DBStats.MaxIdleTimeClosed)
field shows the total number of connections closed due to
`DB.SetConnMaxIdleTime`.
<!-- CL 145758 -->
The new [`DB.SetConnMaxIdleTime`](/pkg/database/sql/#DB.SetConnMaxIdleTime)
method allows removing a connection from the connection pool after
it has been idle for a period of time, without regard to the total
lifespan of the connection. The [`DBStats.MaxIdleTimeClosed`](/pkg/database/sql/#DBStats.MaxIdleTimeClosed)
field shows the total number of connections closed due to
`DB.SetConnMaxIdleTime`.
<!-- CL 214317 -->
The new [`Row.Err`](/pkg/database/sql/#Row.Err) getter
allows checking for query errors without calling
`Row.Scan`.
<!-- CL 214317 -->
The new [`Row.Err`](/pkg/database/sql/#Row.Err) getter
allows checking for query errors without calling
`Row.Scan`.
<!-- database/sql -->
[database/sql/driver](/pkg/database/sql/driver/)
#### [database/sql/driver](/pkg/database/sql/driver/)
: <!-- CL 174122 -->
The new [`Validator`](/pkg/database/sql/driver/#Validator)
interface may be implemented by `Conn` to allow drivers
to signal if a connection is valid or if it should be discarded.
<!-- CL 174122 -->
The new [`Validator`](/pkg/database/sql/driver/#Validator)
interface may be implemented by `Conn` to allow drivers
to signal if a connection is valid or if it should be discarded.
<!-- database/sql/driver -->
[debug/pe](/pkg/debug/pe/)
#### [debug/pe](/pkg/debug/pe/)
: <!-- CL 222637 -->
The package now defines the
`IMAGE_FILE`, `IMAGE_SUBSYSTEM`,
and `IMAGE_DLLCHARACTERISTICS` constants used by the
PE file format.
<!-- CL 222637 -->
The package now defines the
`IMAGE_FILE`, `IMAGE_SUBSYSTEM`,
and `IMAGE_DLLCHARACTERISTICS` constants used by the
PE file format.
<!-- debug/pe -->
[encoding/asn1](/pkg/encoding/asn1/)
#### [encoding/asn1](/pkg/encoding/asn1/)
: <!-- CL 226984 -->
[`Marshal`](/pkg/encoding/asn1/#Marshal) now sorts the components
of SET OF according to X.690 DER.
<!-- CL 226984 -->
[`Marshal`](/pkg/encoding/asn1/#Marshal) now sorts the components
of SET OF according to X.690 DER.
<!-- CL 227320 -->
[`Unmarshal`](/pkg/encoding/asn1/#Unmarshal) now rejects tags and
Object Identifiers which are not minimally encoded according to X.690 DER.
<!-- CL 227320 -->
[`Unmarshal`](/pkg/encoding/asn1/#Unmarshal) now rejects tags and
Object Identifiers which are not minimally encoded according to X.690 DER.
<!-- encoding/asn1 -->
[encoding/json](/pkg/encoding/json/)
#### [encoding/json](/pkg/encoding/json/)
: <!-- CL 199837 -->
The package now has an internal limit to the maximum depth of
nesting when decoding. This reduces the possibility that a
deeply nested input could use large quantities of stack memory,
or even cause a "goroutine stack exceeds limit" panic.
<!-- CL 199837 -->
The package now has an internal limit to the maximum depth of
nesting when decoding. This reduces the possibility that a
deeply nested input could use large quantities of stack memory,
or even cause a "goroutine stack exceeds limit" panic.
<!-- encoding/json -->
[flag](/pkg/flag/)
#### [flag](/pkg/flag/)
: <!-- CL 221427 -->
When the `flag` package sees `-h` or `-help`,
and those flags are not defined, it now prints a usage message.
If the [`FlagSet`](/pkg/flag/#FlagSet) was created with
[`ExitOnError`](/pkg/flag/#ExitOnError),
[`FlagSet.Parse`](/pkg/flag/#FlagSet.Parse) would then
exit with a status of 2. In this release, the exit status for `-h`
or `-help` has been changed to 0. In particular, this applies to
the default handling of command line flags.
<!-- CL 221427 -->
When the `flag` package sees `-h` or `-help`,
and those flags are not defined, it now prints a usage message.
If the [`FlagSet`](/pkg/flag/#FlagSet) was created with
[`ExitOnError`](/pkg/flag/#ExitOnError),
[`FlagSet.Parse`](/pkg/flag/#FlagSet.Parse) would then
exit with a status of 2. In this release, the exit status for `-h`
or `-help` has been changed to 0. In particular, this applies to
the default handling of command line flags.
[fmt](/pkg/fmt/)
#### [fmt](/pkg/fmt/)
: <!-- CL 215001 -->
The printing verbs `%#g` and `%#G` now preserve
trailing zeros for floating-point values.
<!-- CL 215001 -->
The printing verbs `%#g` and `%#G` now preserve
trailing zeros for floating-point values.
<!-- fmt -->
[go/format](/pkg/go/format/)
#### [go/format](/pkg/go/format/)
: <!-- golang.org/issue/37476, CL 231461, CL 240683 -->
The [`Source`](/pkg/go/format/#Source) and
[`Node`](/pkg/go/format/#Node) functions
now canonicalize number literal prefixes and exponents as part
of formatting Go source code. This matches the behavior of the
[`gofmt`](/pkg/cmd/gofmt/) command as it
was implemented [since Go 1.13](/doc/go1.13#gofmt).
<!-- golang.org/issue/37476, CL 231461, CL 240683 -->
The [`Source`](/pkg/go/format/#Source) and
[`Node`](/pkg/go/format/#Node) functions
now canonicalize number literal prefixes and exponents as part
of formatting Go source code. This matches the behavior of the
[`gofmt`](/pkg/cmd/gofmt/) command as it
was implemented [since Go 1.13](/doc/go1.13#gofmt).
<!-- go/format -->
[html/template](/pkg/html/template/)
#### [html/template](/pkg/html/template/)
: <!-- CL 226097 -->
The package now uses Unicode escapes (`\uNNNN`) in all
JavaScript and JSON contexts. This fixes escaping errors in
`application/ld+json` and `application/json`
contexts.
<!-- CL 226097 -->
The package now uses Unicode escapes (`\uNNNN`) in all
JavaScript and JSON contexts. This fixes escaping errors in
`application/ld+json` and `application/json`
contexts.
<!-- html/template -->
[io/ioutil](/pkg/io/ioutil/)
#### [io/ioutil](/pkg/io/ioutil/)
: <!-- CL 212597 -->
[`TempDir`](/pkg/io/ioutil/#TempDir) and
[`TempFile`](/pkg/io/ioutil/#TempFile)
now reject patterns that contain path separators.
That is, calls such as `ioutil.TempFile("/tmp",` `"../base*")` will no longer succeed.
This prevents unintended directory traversal.
<!-- CL 212597 -->
[`TempDir`](/pkg/io/ioutil/#TempDir) and
[`TempFile`](/pkg/io/ioutil/#TempFile)
now reject patterns that contain path separators.
That is, calls such as `ioutil.TempFile("/tmp",` `"../base*")` will no longer succeed.
This prevents unintended directory traversal.
<!-- io/ioutil -->
[math/big](/pkg/math/big/)
#### [math/big](/pkg/math/big/)
: <!-- CL 230397 -->
The new [`Int.FillBytes`](/pkg/math/big/#Int.FillBytes)
method allows serializing to fixed-size pre-allocated byte slices.
<!-- CL 230397 -->
The new [`Int.FillBytes`](/pkg/math/big/#Int.FillBytes)
method allows serializing to fixed-size pre-allocated byte slices.
<!-- math/big -->
[math/cmplx](/pkg/math/cmplx/)
#### [math/cmplx](/pkg/math/cmplx/)
: <!-- CL 220689 -->
The functions in this package were updated to conform to the C99 standard
(Annex G IEC 60559-compatible complex arithmetic) with respect to handling
of special arguments such as infinity, NaN and signed zero.
<!-- CL 220689 -->
The functions in this package were updated to conform to the C99 standard
(Annex G IEC 60559-compatible complex arithmetic) with respect to handling
of special arguments such as infinity, NaN and signed zero.
<!-- math/cmplx-->
[net](/pkg/net/)
#### [net](/pkg/net/)
: <!-- CL 228645 -->
If an I/O operation exceeds a deadline set by
the [`Conn.SetDeadline`](/pkg/net/#Conn),
`Conn.SetReadDeadline`,
or `Conn.SetWriteDeadline` methods, it will now
return an error that is or wraps
[`os.ErrDeadlineExceeded`](/pkg/os/#ErrDeadlineExceeded).
This may be used to reliably detect whether an error is due to
an exceeded deadline.
Earlier releases recommended calling the `Timeout`
method on the error, but I/O operations can return errors for
which `Timeout` returns `true` although a
deadline has not been exceeded.
<!-- CL 228645 -->
If an I/O operation exceeds a deadline set by
the [`Conn.SetDeadline`](/pkg/net/#Conn),
`Conn.SetReadDeadline`,
or `Conn.SetWriteDeadline` methods, it will now
return an error that is or wraps
[`os.ErrDeadlineExceeded`](/pkg/os/#ErrDeadlineExceeded).
This may be used to reliably detect whether an error is due to
an exceeded deadline.
Earlier releases recommended calling the `Timeout`
method on the error, but I/O operations can return errors for
which `Timeout` returns `true` although a
deadline has not been exceeded.
<!-- CL 228641 -->
The new [`Resolver.LookupIP`](/pkg/net/#Resolver.LookupIP)
method supports IP lookups that are both network-specific and accept a context.
<!-- CL 228641 -->
The new [`Resolver.LookupIP`](/pkg/net/#Resolver.LookupIP)
method supports IP lookups that are both network-specific and accept a context.
[net/http](/pkg/net/http/)
#### [net/http](/pkg/net/http/)
: <!-- CL 231418, CL 231419 -->
Parsing is now stricter as a hardening measure against request smuggling attacks:
non-ASCII white space is no longer trimmed like SP and HTAB, and support for the
"`identity`" `Transfer-Encoding` was dropped.
<!-- CL 231418, CL 231419 -->
Parsing is now stricter as a hardening measure against request smuggling attacks:
non-ASCII white space is no longer trimmed like SP and HTAB, and support for the
"`identity`" `Transfer-Encoding` was dropped.
<!-- net/http -->
[net/http/httputil](/pkg/net/http/httputil/)
#### [net/http/httputil](/pkg/net/http/httputil/)
: <!-- CL 230937 -->
[`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
now supports not modifying the `X-Forwarded-For`
header when the incoming `Request.Header` map entry
for that field is `nil`.
<!-- CL 230937 -->
[`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
now supports not modifying the `X-Forwarded-For`
header when the incoming `Request.Header` map entry
for that field is `nil`.
<!-- CL 224897 -->
When a Switching Protocol (like WebSocket) request handled by
[`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
is canceled, the backend connection is now correctly closed.
<!-- CL 224897 -->
When a Switching Protocol (like WebSocket) request handled by
[`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
is canceled, the backend connection is now correctly closed.
[net/http/pprof](/pkg/net/http/pprof/)
#### [net/http/pprof](/pkg/net/http/pprof/)
: <!-- CL 147598, CL 229537 -->
All profile endpoints now support a "`seconds`" parameter. When present,
the endpoint profiles for the specified number of seconds and reports the difference.
The meaning of the "`seconds`" parameter in the `cpu` profile and
the trace endpoints is unchanged.
<!-- CL 147598, CL 229537 -->
All profile endpoints now support a "`seconds`" parameter. When present,
the endpoint profiles for the specified number of seconds and reports the difference.
The meaning of the "`seconds`" parameter in the `cpu` profile and
the trace endpoints is unchanged.
[net/url](/pkg/net/url/)
#### [net/url](/pkg/net/url/)
: <!-- CL 227645 -->
The new [`URL`](/pkg/net/url/#URL) field
`RawFragment` and method [`EscapedFragment`](/pkg/net/url/#URL.EscapedFragment)
provide detail about and control over the exact encoding of a particular fragment.
These are analogous to
`RawPath` and [`EscapedPath`](/pkg/net/url/#URL.EscapedPath).
<!-- CL 227645 -->
The new [`URL`](/pkg/net/url/#URL) field
`RawFragment` and method [`EscapedFragment`](/pkg/net/url/#URL.EscapedFragment)
provide detail about and control over the exact encoding of a particular fragment.
These are analogous to
`RawPath` and [`EscapedPath`](/pkg/net/url/#URL.EscapedPath).
<!-- CL 207082 -->
The new [`URL`](/pkg/net/url/#URL)
method [`Redacted`](/pkg/net/url/#URL.Redacted)
returns the URL in string form with any password replaced with `xxxxx`.
<!-- CL 207082 -->
The new [`URL`](/pkg/net/url/#URL)
method [`Redacted`](/pkg/net/url/#URL.Redacted)
returns the URL in string form with any password replaced with `xxxxx`.
[os](/pkg/os/)
#### [os](/pkg/os/)
: <!-- CL -->
If an I/O operation exceeds a deadline set by
the [`File.SetDeadline`](/pkg/os/#File.SetDeadline),
[`File.SetReadDeadline`](/pkg/os/#File.SetReadDeadline),
or [`File.SetWriteDeadline`](/pkg/os/#File.SetWriteDeadline)
methods, it will now return an error that is or wraps
[`os.ErrDeadlineExceeded`](/pkg/os/#ErrDeadlineExceeded).
This may be used to reliably detect whether an error is due to
an exceeded deadline.
Earlier releases recommended calling the `Timeout`
method on the error, but I/O operations can return errors for
which `Timeout` returns `true` although a
deadline has not been exceeded.
<!-- CL -->
If an I/O operation exceeds a deadline set by
the [`File.SetDeadline`](/pkg/os/#File.SetDeadline),
[`File.SetReadDeadline`](/pkg/os/#File.SetReadDeadline),
or [`File.SetWriteDeadline`](/pkg/os/#File.SetWriteDeadline)
methods, it will now return an error that is or wraps
[`os.ErrDeadlineExceeded`](/pkg/os/#ErrDeadlineExceeded).
This may be used to reliably detect whether an error is due to
an exceeded deadline.
Earlier releases recommended calling the `Timeout`
method on the error, but I/O operations can return errors for
which `Timeout` returns `true` although a
deadline has not been exceeded.
<!-- CL 232862 -->
Packages `os` and `net` now automatically
retry system calls that fail with `EINTR`. Previously
this led to spurious failures, which became more common in Go
1.14 with the addition of asynchronous preemption. Now this is
handled transparently.
<!-- CL 232862 -->
Packages `os` and `net` now automatically
retry system calls that fail with `EINTR`. Previously
this led to spurious failures, which became more common in Go
1.14 with the addition of asynchronous preemption. Now this is
handled transparently.
<!-- CL 229101 -->
The [`os.File`](/pkg/os/#File) type now
supports a [`ReadFrom`](/pkg/os/#File.ReadFrom)
method. This permits the use of the `copy_file_range`
system call on some systems when using
[`io.Copy`](/pkg/io/#Copy) to copy data
from one `os.File` to another. A consequence is that
[`io.CopyBuffer`](/pkg/io/#CopyBuffer)
will not always use the provided buffer when copying to a
`os.File`. If a program wants to force the use of
the provided buffer, it can be done by writing
`io.CopyBuffer(struct{ io.Writer }{dst}, src, buf)`.
<!-- CL 229101 -->
The [`os.File`](/pkg/os/#File) type now
supports a [`ReadFrom`](/pkg/os/#File.ReadFrom)
method. This permits the use of the `copy_file_range`
system call on some systems when using
[`io.Copy`](/pkg/io/#Copy) to copy data
from one `os.File` to another. A consequence is that
[`io.CopyBuffer`](/pkg/io/#CopyBuffer)
will not always use the provided buffer when copying to a
`os.File`. If a program wants to force the use of
the provided buffer, it can be done by writing
`io.CopyBuffer(struct{ io.Writer }{dst}, src, buf)`.
[plugin](/pkg/plugin/)
#### [plugin](/pkg/plugin/)
: <!-- CL 182959 -->
DWARF generation is now supported (and enabled by default) for `-buildmode=plugin` on macOS.
<!-- CL 182959 -->
DWARF generation is now supported (and enabled by default) for `-buildmode=plugin` on macOS.
<!-- CL 191617 -->
Building with `-buildmode=plugin` is now supported on `freebsd/amd64`.
<!-- CL 191617 -->
Building with `-buildmode=plugin` is now supported on `freebsd/amd64`.
[reflect](/pkg/reflect/)
#### [reflect](/pkg/reflect/)
: <!-- CL 228902 -->
Package `reflect` now disallows accessing methods of all
non-exported fields, whereas previously it allowed accessing
those of non-exported, embedded fields. Code that relies on the
previous behavior should be updated to instead access the
corresponding promoted method of the enclosing variable.
<!-- CL 228902 -->
Package `reflect` now disallows accessing methods of all
non-exported fields, whereas previously it allowed accessing
those of non-exported, embedded fields. Code that relies on the
previous behavior should be updated to instead access the
corresponding promoted method of the enclosing variable.
[regexp](/pkg/regexp/)
#### [regexp](/pkg/regexp/)
: <!-- CL 187919 -->
The new [`Regexp.SubexpIndex`](/pkg/regexp/#Regexp.SubexpIndex)
method returns the index of the first subexpression with the given name
within the regular expression.
<!-- CL 187919 -->
The new [`Regexp.SubexpIndex`](/pkg/regexp/#Regexp.SubexpIndex)
method returns the index of the first subexpression with the given name
within the regular expression.
<!-- regexp -->
[runtime](/pkg/runtime/)
#### [runtime](/pkg/runtime/)
: <!-- CL 216557 -->
Several functions, including
[`ReadMemStats`](/pkg/runtime/#ReadMemStats)
and
[`GoroutineProfile`](/pkg/runtime/#GoroutineProfile),
no longer block if a garbage collection is in progress.
<!-- CL 216557 -->
Several functions, including
[`ReadMemStats`](/pkg/runtime/#ReadMemStats)
and
[`GoroutineProfile`](/pkg/runtime/#GoroutineProfile),
no longer block if a garbage collection is in progress.
[runtime/pprof](/pkg/runtime/pprof/)
#### [runtime/pprof](/pkg/runtime/pprof/)
: <!-- CL 189318 -->
The goroutine profile now includes the profile labels associated with each
goroutine at the time of profiling. This feature is not yet implemented for
the profile reported with `debug=2`.
<!-- CL 189318 -->
The goroutine profile now includes the profile labels associated with each
goroutine at the time of profiling. This feature is not yet implemented for
the profile reported with `debug=2`.
[strconv](/pkg/strconv/)
#### [strconv](/pkg/strconv/)
: <!-- CL 216617 -->
[`FormatComplex`](/pkg/strconv/#FormatComplex) and [`ParseComplex`](/pkg/strconv/#ParseComplex) are added for working with complex numbers.
<!-- CL 216617 -->
[`FormatComplex`](/pkg/strconv/#FormatComplex) and [`ParseComplex`](/pkg/strconv/#ParseComplex) are added for working with complex numbers.
[`FormatComplex`](/pkg/strconv/#FormatComplex) converts a complex number into a string of the form (a+bi), where a and b are the real and imaginary parts.
[`FormatComplex`](/pkg/strconv/#FormatComplex) converts a complex number into a string of the form (a+bi), where a and b are the real and imaginary parts.
[`ParseComplex`](/pkg/strconv/#ParseComplex) converts a string into a complex number of a specified precision. `ParseComplex` accepts complex numbers in the format `N+Ni`.
[`ParseComplex`](/pkg/strconv/#ParseComplex) converts a string into a complex number of a specified precision. `ParseComplex` accepts complex numbers in the format `N+Ni`.
<!-- strconv -->
[sync](/pkg/sync/)
#### [sync](/pkg/sync/)
: <!-- CL 205899, golang.org/issue/33762 -->
The new method
[`Map.LoadAndDelete`](/pkg/sync/#Map.LoadAndDelete)
atomically deletes a key and returns the previous value if present.
<!-- CL 205899, golang.org/issue/33762 -->
The new method
[`Map.LoadAndDelete`](/pkg/sync/#Map.LoadAndDelete)
atomically deletes a key and returns the previous value if present.
<!-- CL 205899 -->
The method
[`Map.Delete`](/pkg/sync/#Map.Delete)
is more efficient.
<!-- CL 205899 -->
The method
[`Map.Delete`](/pkg/sync/#Map.Delete)
is more efficient.
<!-- sync -->
[syscall](/pkg/syscall/)
#### [syscall](/pkg/syscall/)
: <!-- CL 231638 -->
On Unix systems, functions that use
[`SysProcAttr`](/pkg/syscall/#SysProcAttr)
will now reject attempts to set both the `Setctty`
and `Foreground` fields, as they both use
the `Ctty` field but do so in incompatible ways.
We expect that few existing programs set both fields.
<!-- CL 231638 -->
On Unix systems, functions that use
[`SysProcAttr`](/pkg/syscall/#SysProcAttr)
will now reject attempts to set both the `Setctty`
and `Foreground` fields, as they both use
the `Ctty` field but do so in incompatible ways.
We expect that few existing programs set both fields.
Setting the `Setctty` field now requires that the
`Ctty` field be set to a file descriptor number in the
child process, as determined by the `ProcAttr.Files` field.
Using a child descriptor always worked, but there were certain
cases where using a parent file descriptor also happened to work.
Some programs that set `Setctty` will need to change
the value of `Ctty` to use a child descriptor number.
Setting the `Setctty` field now requires that the
`Ctty` field be set to a file descriptor number in the
child process, as determined by the `ProcAttr.Files` field.
Using a child descriptor always worked, but there were certain
cases where using a parent file descriptor also happened to work.
Some programs that set `Setctty` will need to change
the value of `Ctty` to use a child descriptor number.
<!-- CL 220578 -->
It is [now possible](/pkg/syscall/#Proc.Call) to call
system calls that return floating point values
on `windows/amd64`.
<!-- CL 220578 -->
It is [now possible](/pkg/syscall/#Proc.Call) to call
system calls that return floating point values
on `windows/amd64`.
[testing](/pkg/testing/)
#### [testing](/pkg/testing/)
: <!-- golang.org/issue/28135 -->
The `testing.T` type now has a
[`Deadline`](/pkg/testing/#T.Deadline) method
that reports the time at which the test binary will have exceeded its
timeout.
<!-- golang.org/issue/28135 -->
The `testing.T` type now has a
[`Deadline`](/pkg/testing/#T.Deadline) method
that reports the time at which the test binary will have exceeded its
timeout.
<!-- golang.org/issue/34129 -->
A `TestMain` function is no longer required to call
`os.Exit`. If a `TestMain` function returns,
the test binary will call `os.Exit` with the value returned
by `m.Run`.
<!-- golang.org/issue/34129 -->
A `TestMain` function is no longer required to call
`os.Exit`. If a `TestMain` function returns,
the test binary will call `os.Exit` with the value returned
by `m.Run`.
<!-- CL 226877, golang.org/issue/35998 -->
The new methods
[`T.TempDir`](/pkg/testing/#T.TempDir) and
[`B.TempDir`](/pkg/testing/#B.TempDir)
return temporary directories that are automatically cleaned up
at the end of the test.
<!-- CL 226877, golang.org/issue/35998 -->
The new methods
[`T.TempDir`](/pkg/testing/#T.TempDir) and
[`B.TempDir`](/pkg/testing/#B.TempDir)
return temporary directories that are automatically cleaned up
at the end of the test.
<!-- CL 229085 -->
`go` `test` `-v` now groups output by
test name, rather than printing the test name on each line.
<!-- CL 229085 -->
`go` `test` `-v` now groups output by
test name, rather than printing the test name on each line.
<!-- testing -->
[text/template](/pkg/text/template/)
#### [text/template](/pkg/text/template/)
: <!-- CL 226097 -->
[`JSEscape`](/pkg/text/template/#JSEscape) now
consistently uses Unicode escapes (`\u00XX`), which are
compatible with JSON.
<!-- CL 226097 -->
[`JSEscape`](/pkg/text/template/#JSEscape) now
consistently uses Unicode escapes (`\u00XX`), which are
compatible with JSON.
<!-- text/template -->
[time](/pkg/time/)
#### [time](/pkg/time/)
: <!-- CL 220424, CL 217362, golang.org/issue/33184 -->
The new method
[`Ticker.Reset`](/pkg/time/#Ticker.Reset)
supports changing the duration of a ticker.
<!-- CL 220424, CL 217362, golang.org/issue/33184 -->
The new method
[`Ticker.Reset`](/pkg/time/#Ticker.Reset)
supports changing the duration of a ticker.
<!-- CL 227878 -->
When returning an error, [`ParseDuration`](/pkg/time/#ParseDuration) now quotes the original value.
<!-- CL 227878 -->
When returning an error, [`ParseDuration`](/pkg/time/#ParseDuration) now quotes the original value.
<!-- time -->

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -368,512 +368,512 @@ As always, there are various minor changes and updates to the library,
made with the Go 1 [promise of compatibility](/doc/go1compat)
in mind.
[archive/zip](/pkg/archive/zip/)
#### [archive/zip](/pkg/archive/zip/)
: <!-- CL 39570 -->
The
ZIP [`Writer`](/pkg/archive/zip/#Writer)
now sets the UTF-8 bit in
the [`FileHeader.Flags`](/pkg/archive/zip/#FileHeader.Flags)
when appropriate.
<!-- CL 39570 -->
The
ZIP [`Writer`](/pkg/archive/zip/#Writer)
now sets the UTF-8 bit in
the [`FileHeader.Flags`](/pkg/archive/zip/#FileHeader.Flags)
when appropriate.
<!-- archive/zip -->
[crypto/rand](/pkg/crypto/rand/)
#### [crypto/rand](/pkg/crypto/rand/)
: <!-- CL 43852 -->
On Linux, Go now calls the `getrandom` system call
without the `GRND_NONBLOCK` flag; it will now block
until the kernel has sufficient randomness. On kernels predating
the `getrandom` system call, Go continues to read
from `/dev/urandom`.
<!-- CL 43852 -->
On Linux, Go now calls the `getrandom` system call
without the `GRND_NONBLOCK` flag; it will now block
until the kernel has sufficient randomness. On kernels predating
the `getrandom` system call, Go continues to read
from `/dev/urandom`.
<!-- crypto/rand -->
[crypto/x509](/pkg/crypto/x509/)
#### [crypto/x509](/pkg/crypto/x509/)
: <!-- CL 36093 -->
On Unix systems the environment
variables `SSL_CERT_FILE`
and `SSL_CERT_DIR` can now be used to override the
system default locations for the SSL certificate file and SSL
certificate files directory, respectively.
<!-- CL 36093 -->
On Unix systems the environment
variables `SSL_CERT_FILE`
and `SSL_CERT_DIR` can now be used to override the
system default locations for the SSL certificate file and SSL
certificate files directory, respectively.
The FreeBSD file `/usr/local/etc/ssl/cert.pem` is
now included in the certificate search path.
The FreeBSD file `/usr/local/etc/ssl/cert.pem` is
now included in the certificate search path.
<!-- CL 36900 -->
The package now supports excluded domains in name constraints.
In addition to enforcing such constraints,
[`CreateCertificate`](/pkg/crypto/x509/#CreateCertificate)
will create certificates with excluded name constraints
if the provided template certificate has the new
field
[`ExcludedDNSDomains`](/pkg/crypto/x509/#Certificate.ExcludedDNSDomains)
populated.
<!-- CL 36900 -->
The package now supports excluded domains in name constraints.
In addition to enforcing such constraints,
[`CreateCertificate`](/pkg/crypto/x509/#CreateCertificate)
will create certificates with excluded name constraints
if the provided template certificate has the new
field
[`ExcludedDNSDomains`](/pkg/crypto/x509/#Certificate.ExcludedDNSDomains)
populated.
<!-- CL 36696 -->
If any SAN extension, including with no DNS names, is present
in the certificate, then the Common Name from
[`Subject`](/pkg/crypto/x509/#Certificate.Subject) is ignored.
In previous releases, the code tested only whether DNS-name SANs were
present in a certificate.
<!-- CL 36696 -->
If any SAN extension, including with no DNS names, is present
in the certificate, then the Common Name from
[`Subject`](/pkg/crypto/x509/#Certificate.Subject) is ignored.
In previous releases, the code tested only whether DNS-name SANs were
present in a certificate.
<!-- crypto/x509 -->
[database/sql](/pkg/database/sql/)
#### [database/sql](/pkg/database/sql/)
: <!-- CL 35476 -->
The package will now use a cached [`Stmt`](/pkg/database/sql/#Stmt) if
available in [`Tx.Stmt`](/pkg/database/sql/#Tx.Stmt).
This prevents statements from being re-prepared each time
[`Tx.Stmt`](/pkg/database/sql/#Tx.Stmt) is called.
<!-- CL 35476 -->
The package will now use a cached [`Stmt`](/pkg/database/sql/#Stmt) if
available in [`Tx.Stmt`](/pkg/database/sql/#Tx.Stmt).
This prevents statements from being re-prepared each time
[`Tx.Stmt`](/pkg/database/sql/#Tx.Stmt) is called.
<!-- CL 38533 -->
The package now allows drivers to implement their own argument checkers by implementing
[`driver.NamedValueChecker`](/pkg/database/sql/driver/#NamedValueChecker).
This also allows drivers to support `OUTPUT` and `INOUT` parameter types.
[`Out`](/pkg/database/sql/#Out) should be used to return output parameters
when supported by the driver.
<!-- CL 38533 -->
The package now allows drivers to implement their own argument checkers by implementing
[`driver.NamedValueChecker`](/pkg/database/sql/driver/#NamedValueChecker).
This also allows drivers to support `OUTPUT` and `INOUT` parameter types.
[`Out`](/pkg/database/sql/#Out) should be used to return output parameters
when supported by the driver.
<!-- CL 39031 -->
[`Rows.Scan`](/pkg/database/sql/#Rows.Scan) can now scan user-defined string types.
Previously the package supported scanning into numeric types like `type` `Int` `int64`. It now also supports
scanning into string types like `type` `String` `string`.
<!-- CL 39031 -->
[`Rows.Scan`](/pkg/database/sql/#Rows.Scan) can now scan user-defined string types.
Previously the package supported scanning into numeric types like `type` `Int` `int64`. It now also supports
scanning into string types like `type` `String` `string`.
<!-- CL 40694 -->
The new [`DB.Conn`](/pkg/database/sql/#DB.Conn) method returns the new
[`Conn`](/pkg/database/sql/#Conn) type representing an
exclusive connection to the database from the connection pool. All queries run on
a [`Conn`](/pkg/database/sql/#Conn) will use the same underlying
connection until [`Conn.Close`](/pkg/database/sql/#Conn.Close) is called
to return the connection to the connection pool.
<!-- CL 40694 -->
The new [`DB.Conn`](/pkg/database/sql/#DB.Conn) method returns the new
[`Conn`](/pkg/database/sql/#Conn) type representing an
exclusive connection to the database from the connection pool. All queries run on
a [`Conn`](/pkg/database/sql/#Conn) will use the same underlying
connection until [`Conn.Close`](/pkg/database/sql/#Conn.Close) is called
to return the connection to the connection pool.
<!-- database/sql -->
[encoding/asn1](/pkg/encoding/asn1/)
#### [encoding/asn1](/pkg/encoding/asn1/)
: <!-- CL 38660 -->
The new
[`NullBytes`](/pkg/encoding/asn1/#NullBytes)
and
[`NullRawValue`](/pkg/encoding/asn1/#NullRawValue)
represent the ASN.1 NULL type.
<!-- CL 38660 -->
The new
[`NullBytes`](/pkg/encoding/asn1/#NullBytes)
and
[`NullRawValue`](/pkg/encoding/asn1/#NullRawValue)
represent the ASN.1 NULL type.
<!-- encoding/asn1 -->
[encoding/base32](/pkg/encoding/base32/)
#### [encoding/base32](/pkg/encoding/base32/)
: <!-- CL 38634 -->
The new [Encoding.WithPadding](/pkg/encoding/base32/#Encoding.WithPadding)
method adds support for custom padding characters and disabling padding.
<!-- CL 38634 -->
The new [Encoding.WithPadding](/pkg/encoding/base32/#Encoding.WithPadding)
method adds support for custom padding characters and disabling padding.
<!-- encoding/base32 -->
[encoding/csv](/pkg/encoding/csv/)
#### [encoding/csv](/pkg/encoding/csv/)
: <!-- CL 41730 -->
The new field
[`Reader.ReuseRecord`](/pkg/encoding/csv/#Reader.ReuseRecord)
controls whether calls to
[`Read`](/pkg/encoding/csv/#Reader.Read)
may return a slice sharing the backing array of the previous
call's returned slice for improved performance.
<!-- CL 41730 -->
The new field
[`Reader.ReuseRecord`](/pkg/encoding/csv/#Reader.ReuseRecord)
controls whether calls to
[`Read`](/pkg/encoding/csv/#Reader.Read)
may return a slice sharing the backing array of the previous
call's returned slice for improved performance.
<!-- encoding/csv -->
[fmt](/pkg/fmt/)
#### [fmt](/pkg/fmt/)
: <!-- CL 37051 -->
The sharp flag ('`#`') is now supported when printing
floating point and complex numbers. It will always print a
decimal point
for `%e`, `%E`, `%f`, `%F`, `%g`
and `%G`; it will not remove trailing zeros
for `%g` and `%G`.
<!-- CL 37051 -->
The sharp flag ('`#`') is now supported when printing
floating point and complex numbers. It will always print a
decimal point
for `%e`, `%E`, `%f`, `%F`, `%g`
and `%G`; it will not remove trailing zeros
for `%g` and `%G`.
<!-- fmt -->
[hash/fnv](/pkg/hash/fnv/)
#### [hash/fnv](/pkg/hash/fnv/)
: <!-- CL 38356 -->
The package now includes 128-bit FNV-1 and FNV-1a hash support with
[`New128`](/pkg/hash/fnv/#New128) and
[`New128a`](/pkg/hash/fnv/#New128a), respectively.
<!-- CL 38356 -->
The package now includes 128-bit FNV-1 and FNV-1a hash support with
[`New128`](/pkg/hash/fnv/#New128) and
[`New128a`](/pkg/hash/fnv/#New128a), respectively.
<!-- hash/fnv -->
[html/template](/pkg/html/template/)
#### [html/template](/pkg/html/template/)
: <!-- CL 37880, CL 40936 -->
The package now reports an error if a predefined escaper (one of
"html", "urlquery" and "js") is found in a pipeline and does not match
what the auto-escaper would have decided on its own.
This avoids certain security or correctness issues.
Now use of one of these escapers is always either a no-op or an error.
(The no-op case eases migration from [text/template](/pkg/text/template/).)
<!-- CL 37880, CL 40936 -->
The package now reports an error if a predefined escaper (one of
"html", "urlquery" and "js") is found in a pipeline and does not match
what the auto-escaper would have decided on its own.
This avoids certain security or correctness issues.
Now use of one of these escapers is always either a no-op or an error.
(The no-op case eases migration from [text/template](/pkg/text/template/).)
<!-- html/template -->
[image](/pkg/image/)
#### [image](/pkg/image/)
: <!-- CL 36734 -->
The [`Rectangle.Intersect`](/pkg/image/#Rectangle.Intersect)
method now returns a zero `Rectangle` when called on
adjacent but non-overlapping rectangles, as documented. In
earlier releases it would incorrectly return an empty but
non-zero `Rectangle`.
<!-- CL 36734 -->
The [`Rectangle.Intersect`](/pkg/image/#Rectangle.Intersect)
method now returns a zero `Rectangle` when called on
adjacent but non-overlapping rectangles, as documented. In
earlier releases it would incorrectly return an empty but
non-zero `Rectangle`.
<!-- image -->
[image/color](/pkg/image/color/)
#### [image/color](/pkg/image/color/)
: <!-- CL 36732 -->
The YCbCr to RGBA conversion formula has been tweaked to ensure
that rounding adjustments span the complete [0, 0xffff] RGBA
range.
<!-- CL 36732 -->
The YCbCr to RGBA conversion formula has been tweaked to ensure
that rounding adjustments span the complete [0, 0xffff] RGBA
range.
<!-- image/color -->
[image/png](/pkg/image/png/)
#### [image/png](/pkg/image/png/)
: <!-- CL 34150 -->
The new [`Encoder.BufferPool`](/pkg/image/png/#Encoder.BufferPool)
field allows specifying an [`EncoderBufferPool`](/pkg/image/png/#EncoderBufferPool),
that will be used by the encoder to get temporary `EncoderBuffer`
buffers when encoding a PNG image.
The use of a `BufferPool` reduces the number of
memory allocations performed while encoding multiple images.
<!-- CL 34150 -->
The new [`Encoder.BufferPool`](/pkg/image/png/#Encoder.BufferPool)
field allows specifying an [`EncoderBufferPool`](/pkg/image/png/#EncoderBufferPool),
that will be used by the encoder to get temporary `EncoderBuffer`
buffers when encoding a PNG image.
The use of a `BufferPool` reduces the number of
memory allocations performed while encoding multiple images.
<!-- CL 38271 -->
The package now supports the decoding of transparent 8-bit
grayscale ("Gray8") images.
<!-- CL 38271 -->
The package now supports the decoding of transparent 8-bit
grayscale ("Gray8") images.
<!-- image/png -->
[math/big](/pkg/math/big/)
#### [math/big](/pkg/math/big/)
: <!-- CL 36487 -->
The new
[`IsInt64`](/pkg/math/big/#Int.IsInt64)
and
[`IsUint64`](/pkg/math/big/#Int.IsUint64)
methods report whether an `Int`
may be represented as an `int64` or `uint64`
value.
<!-- CL 36487 -->
The new
[`IsInt64`](/pkg/math/big/#Int.IsInt64)
and
[`IsUint64`](/pkg/math/big/#Int.IsUint64)
methods report whether an `Int`
may be represented as an `int64` or `uint64`
value.
<!-- math/big -->
[mime/multipart](/pkg/mime/multipart/)
#### [mime/multipart](/pkg/mime/multipart/)
: <!-- CL 39223 -->
The new
[`FileHeader.Size`](/pkg/mime/multipart/#FileHeader.Size)
field describes the size of a file in a multipart message.
<!-- CL 39223 -->
The new
[`FileHeader.Size`](/pkg/mime/multipart/#FileHeader.Size)
field describes the size of a file in a multipart message.
<!-- mime/multipart -->
[net](/pkg/net/)
#### [net](/pkg/net/)
: <!-- CL 32572 -->
The new
[`Resolver.StrictErrors`](/pkg/net/#Resolver.StrictErrors)
provides control over how Go's built-in DNS resolver handles
temporary errors during queries composed of multiple sub-queries,
such as an A+AAAA address lookup.
<!-- CL 32572 -->
The new
[`Resolver.StrictErrors`](/pkg/net/#Resolver.StrictErrors)
provides control over how Go's built-in DNS resolver handles
temporary errors during queries composed of multiple sub-queries,
such as an A+AAAA address lookup.
<!-- CL 37260 -->
The new
[`Resolver.Dial`](/pkg/net/#Resolver.Dial)
allows a `Resolver` to use a custom dial function.
<!-- CL 37260 -->
The new
[`Resolver.Dial`](/pkg/net/#Resolver.Dial)
allows a `Resolver` to use a custom dial function.
<!-- CL 40510 -->
[`JoinHostPort`](/pkg/net/#JoinHostPort) now only places an address in square brackets if the host contains a colon.
In previous releases it would also wrap addresses in square brackets if they contained a percent ('`%`') sign.
<!-- CL 40510 -->
[`JoinHostPort`](/pkg/net/#JoinHostPort) now only places an address in square brackets if the host contains a colon.
In previous releases it would also wrap addresses in square brackets if they contained a percent ('`%`') sign.
<!-- CL 37913 -->
The new methods
[`TCPConn.SyscallConn`](/pkg/net/#TCPConn.SyscallConn),
[`IPConn.SyscallConn`](/pkg/net/#IPConn.SyscallConn),
[`UDPConn.SyscallConn`](/pkg/net/#UDPConn.SyscallConn),
and
[`UnixConn.SyscallConn`](/pkg/net/#UnixConn.SyscallConn)
provide access to the connections' underlying file descriptors.
<!-- CL 37913 -->
The new methods
[`TCPConn.SyscallConn`](/pkg/net/#TCPConn.SyscallConn),
[`IPConn.SyscallConn`](/pkg/net/#IPConn.SyscallConn),
[`UDPConn.SyscallConn`](/pkg/net/#UDPConn.SyscallConn),
and
[`UnixConn.SyscallConn`](/pkg/net/#UnixConn.SyscallConn)
provide access to the connections' underlying file descriptors.
<!-- 45088 -->
It is now safe to call [`Dial`](/pkg/net/#Dial) with the address obtained from
`(*TCPListener).String()` after creating the listener with
<code>[Listen](/pkg/net/#Listen)("tcp", ":0")</code>.
Previously it failed on some machines with half-configured IPv6 stacks.
<!-- 45088 -->
It is now safe to call [`Dial`](/pkg/net/#Dial) with the address obtained from
`(*TCPListener).String()` after creating the listener with
<code>[Listen](/pkg/net/#Listen)("tcp", ":0")</code>.
Previously it failed on some machines with half-configured IPv6 stacks.
<!-- net -->
[net/http](/pkg/net/http/)
#### [net/http](/pkg/net/http/)
: <!-- CL 37328 -->
The [`Cookie.String`](/pkg/net/http/#Cookie.String) method, used for
`Cookie` and `Set-Cookie` headers, now encloses values in double quotes
if the value contains either a space or a comma.
<!-- CL 37328 -->
The [`Cookie.String`](/pkg/net/http/#Cookie.String) method, used for
`Cookie` and `Set-Cookie` headers, now encloses values in double quotes
if the value contains either a space or a comma.
Server changes:
Server changes:
- <!-- CL 38194 -->
[`ServeMux`](/pkg/net/http/#ServeMux) now ignores ports in the host
header when matching handlers. The host is matched unmodified for `CONNECT` requests.
- <!-- CL 44074 -->
The new [`Server.ServeTLS`](/pkg/net/http/#Server.ServeTLS) method wraps
[`Server.Serve`](/pkg/net/http/#Server.Serve) with added TLS support.
- <!-- CL 34727 -->
[`Server.WriteTimeout`](/pkg/net/http/#Server.WriteTimeout)
now applies to HTTP/2 connections and is enforced per-stream.
- <!-- CL 43231 -->
HTTP/2 now uses the priority write scheduler by default.
Frames are scheduled by following HTTP/2 priorities as described in
[RFC 7540 Section 5.3](https://tools.ietf.org/html/rfc7540#section-5.3).
- <!-- CL 36483 -->
The HTTP handler returned by [`StripPrefix`](/pkg/net/http/#StripPrefix)
now calls its provided handler with a modified clone of the original `*http.Request`.
Any code storing per-request state in maps keyed by `*http.Request` should
use
[`Request.Context`](/pkg/net/http/#Request.Context),
[`Request.WithContext`](/pkg/net/http/#Request.WithContext),
and
[`context.WithValue`](/pkg/context/#WithValue) instead.
- <!-- CL 35490 -->
[`LocalAddrContextKey`](/pkg/net/http/#LocalAddrContextKey) now contains
the connection's actual network address instead of the interface address used by the listener.
- <!-- CL 38194 -->
[`ServeMux`](/pkg/net/http/#ServeMux) now ignores ports in the host
header when matching handlers. The host is matched unmodified for `CONNECT` requests.
- <!-- CL 44074 -->
The new [`Server.ServeTLS`](/pkg/net/http/#Server.ServeTLS) method wraps
[`Server.Serve`](/pkg/net/http/#Server.Serve) with added TLS support.
- <!-- CL 34727 -->
[`Server.WriteTimeout`](/pkg/net/http/#Server.WriteTimeout)
now applies to HTTP/2 connections and is enforced per-stream.
- <!-- CL 43231 -->
HTTP/2 now uses the priority write scheduler by default.
Frames are scheduled by following HTTP/2 priorities as described in
[RFC 7540 Section 5.3](https://tools.ietf.org/html/rfc7540#section-5.3).
- <!-- CL 36483 -->
The HTTP handler returned by [`StripPrefix`](/pkg/net/http/#StripPrefix)
now calls its provided handler with a modified clone of the original `*http.Request`.
Any code storing per-request state in maps keyed by `*http.Request` should
use
[`Request.Context`](/pkg/net/http/#Request.Context),
[`Request.WithContext`](/pkg/net/http/#Request.WithContext),
and
[`context.WithValue`](/pkg/context/#WithValue) instead.
- <!-- CL 35490 -->
[`LocalAddrContextKey`](/pkg/net/http/#LocalAddrContextKey) now contains
the connection's actual network address instead of the interface address used by the listener.
Client & Transport changes:
Client & Transport changes:
- <!-- CL 35488 -->
The [`Transport`](/pkg/net/http/#Transport)
now supports making requests via SOCKS5 proxy when the URL returned by
[`Transport.Proxy`](/pkg/net/http/#Transport.Proxy)
has the scheme `socks5`.
- <!-- CL 35488 -->
The [`Transport`](/pkg/net/http/#Transport)
now supports making requests via SOCKS5 proxy when the URL returned by
[`Transport.Proxy`](/pkg/net/http/#Transport.Proxy)
has the scheme `socks5`.
<!-- net/http -->
[net/http/fcgi](/pkg/net/http/fcgi/)
#### [net/http/fcgi](/pkg/net/http/fcgi/)
: <!-- CL 40012 -->
The new
[`ProcessEnv`](/pkg/net/http/fcgi/#ProcessEnv)
function returns FastCGI environment variables associated with an HTTP request
for which there are no appropriate
[`http.Request`](/pkg/net/http/#Request)
fields, such as `REMOTE_USER`.
<!-- CL 40012 -->
The new
[`ProcessEnv`](/pkg/net/http/fcgi/#ProcessEnv)
function returns FastCGI environment variables associated with an HTTP request
for which there are no appropriate
[`http.Request`](/pkg/net/http/#Request)
fields, such as `REMOTE_USER`.
<!-- net/http/fcgi -->
[net/http/httptest](/pkg/net/http/httptest/)
#### [net/http/httptest](/pkg/net/http/httptest/)
: <!-- CL 34639 -->
The new
[`Server.Client`](/pkg/net/http/httptest/#Server.Client)
method returns an HTTP client configured for making requests to the test server.
<!-- CL 34639 -->
The new
[`Server.Client`](/pkg/net/http/httptest/#Server.Client)
method returns an HTTP client configured for making requests to the test server.
The new
[`Server.Certificate`](/pkg/net/http/httptest/#Server.Certificate)
method returns the test server's TLS certificate, if any.
The new
[`Server.Certificate`](/pkg/net/http/httptest/#Server.Certificate)
method returns the test server's TLS certificate, if any.
<!-- net/http/httptest -->
[net/http/httputil](/pkg/net/http/httputil/)
#### [net/http/httputil](/pkg/net/http/httputil/)
: <!-- CL 43712 -->
The [`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
now proxies all HTTP/2 response trailers, even those not declared in the initial response
header. Such undeclared trailers are used by the gRPC protocol.
<!-- CL 43712 -->
The [`ReverseProxy`](/pkg/net/http/httputil/#ReverseProxy)
now proxies all HTTP/2 response trailers, even those not declared in the initial response
header. Such undeclared trailers are used by the gRPC protocol.
<!-- net/http/httputil -->
[os](/pkg/os/)
#### [os](/pkg/os/)
: <!-- CL 36800 -->
The `os` package now uses the internal runtime poller
for file I/O.
This reduces the number of threads required for read/write
operations on pipes, and it eliminates races when one goroutine
closes a file while another is using the file for I/O.
<!-- CL 36800 -->
The `os` package now uses the internal runtime poller
for file I/O.
This reduces the number of threads required for read/write
operations on pipes, and it eliminates races when one goroutine
closes a file while another is using the file for I/O.
<!-- CL 37915 -->
On Windows,
[`Args`](/pkg/os/#Args)
is now populated without `shell32.dll`, improving process start-up time by 1-7 ms.
<!-- CL 37915 -->
On Windows,
[`Args`](/pkg/os/#Args)
is now populated without `shell32.dll`, improving process start-up time by 1-7 ms.
<!-- os -->
[os/exec](/pkg/os/exec/)
#### [os/exec](/pkg/os/exec/)
: <!-- CL 37586 -->
The `os/exec` package now prevents child processes from being created with
any duplicate environment variables.
If [`Cmd.Env`](/pkg/os/exec/#Cmd.Env)
contains duplicate environment keys, only the last
value in the slice for each duplicate key is used.
<!-- CL 37586 -->
The `os/exec` package now prevents child processes from being created with
any duplicate environment variables.
If [`Cmd.Env`](/pkg/os/exec/#Cmd.Env)
contains duplicate environment keys, only the last
value in the slice for each duplicate key is used.
<!-- os/exec -->
[os/user](/pkg/os/user/)
#### [os/user](/pkg/os/user/)
: <!-- CL 37664 -->
[`Lookup`](/pkg/os/user/#Lookup) and
[`LookupId`](/pkg/os/user/#LookupId) now
work on Unix systems when `CGO_ENABLED=0` by reading
the `/etc/passwd` file.
<!-- CL 37664 -->
[`Lookup`](/pkg/os/user/#Lookup) and
[`LookupId`](/pkg/os/user/#LookupId) now
work on Unix systems when `CGO_ENABLED=0` by reading
the `/etc/passwd` file.
<!-- CL 33713 -->
[`LookupGroup`](/pkg/os/user/#LookupGroup) and
[`LookupGroupId`](/pkg/os/user/#LookupGroupId) now
work on Unix systems when `CGO_ENABLED=0` by reading
the `/etc/group` file.
<!-- CL 33713 -->
[`LookupGroup`](/pkg/os/user/#LookupGroup) and
[`LookupGroupId`](/pkg/os/user/#LookupGroupId) now
work on Unix systems when `CGO_ENABLED=0` by reading
the `/etc/group` file.
<!-- os/user -->
[reflect](/pkg/reflect/)
#### [reflect](/pkg/reflect/)
: <!-- CL 38335 -->
The new
[`MakeMapWithSize`](/pkg/reflect/#MakeMapWithSize)
function creates a map with a capacity hint.
<!-- CL 38335 -->
The new
[`MakeMapWithSize`](/pkg/reflect/#MakeMapWithSize)
function creates a map with a capacity hint.
<!-- reflect -->
[runtime](/pkg/runtime/)
#### [runtime](/pkg/runtime/)
: <!-- CL 37233, CL 37726 -->
Tracebacks generated by the runtime and recorded in profiles are
now accurate in the presence of inlining.
To retrieve tracebacks programmatically, applications should use
[`runtime.CallersFrames`](/pkg/runtime/#CallersFrames)
rather than directly iterating over the results of
[`runtime.Callers`](/pkg/runtime/#Callers).
<!-- CL 37233, CL 37726 -->
Tracebacks generated by the runtime and recorded in profiles are
now accurate in the presence of inlining.
To retrieve tracebacks programmatically, applications should use
[`runtime.CallersFrames`](/pkg/runtime/#CallersFrames)
rather than directly iterating over the results of
[`runtime.Callers`](/pkg/runtime/#Callers).
<!-- CL 38403 -->
On Windows, Go no longer forces the system timer to run at high
resolution when the program is idle.
This should reduce the impact of Go programs on battery life.
<!-- CL 38403 -->
On Windows, Go no longer forces the system timer to run at high
resolution when the program is idle.
This should reduce the impact of Go programs on battery life.
<!-- CL 29341 -->
On FreeBSD, `GOMAXPROCS` and
[`runtime.NumCPU`](/pkg/runtime/#NumCPU)
are now based on the process' CPU mask, rather than the total
number of CPUs.
<!-- CL 29341 -->
On FreeBSD, `GOMAXPROCS` and
[`runtime.NumCPU`](/pkg/runtime/#NumCPU)
are now based on the process' CPU mask, rather than the total
number of CPUs.
<!-- CL 43641 -->
The runtime has preliminary support for Android O.
<!-- CL 43641 -->
The runtime has preliminary support for Android O.
<!-- runtime -->
[runtime/debug](/pkg/runtime/debug/)
#### [runtime/debug](/pkg/runtime/debug/)
: <!-- CL 34013 -->
Calling
[`SetGCPercent`](/pkg/runtime/debug/#SetGCPercent)
with a negative value no longer runs an immediate garbage collection.
<!-- CL 34013 -->
Calling
[`SetGCPercent`](/pkg/runtime/debug/#SetGCPercent)
with a negative value no longer runs an immediate garbage collection.
<!-- runtime/debug -->
[runtime/trace](/pkg/runtime/trace/)
#### [runtime/trace](/pkg/runtime/trace/)
: <!-- CL 36015 -->
The execution trace now displays mark assist events, which
indicate when an application goroutine is forced to assist
garbage collection because it is allocating too quickly.
<!-- CL 36015 -->
The execution trace now displays mark assist events, which
indicate when an application goroutine is forced to assist
garbage collection because it is allocating too quickly.
<!-- CL 40810 -->
"Sweep" events now encompass the entire process of finding free
space for an allocation, rather than recording each individual
span that is swept.
This reduces allocation latency when tracing allocation-heavy
programs.
The sweep event shows how many bytes were swept and how many
were reclaimed.
<!-- CL 40810 -->
"Sweep" events now encompass the entire process of finding free
space for an allocation, rather than recording each individual
span that is swept.
This reduces allocation latency when tracing allocation-heavy
programs.
The sweep event shows how many bytes were swept and how many
were reclaimed.
<!-- runtime/trace -->
[sync](/pkg/sync/)
#### [sync](/pkg/sync/)
: <!-- CL 34310 -->
[`Mutex`](/pkg/sync/#Mutex) is now more fair.
<!-- CL 34310 -->
[`Mutex`](/pkg/sync/#Mutex) is now more fair.
<!-- sync -->
[syscall](/pkg/syscall/)
#### [syscall](/pkg/syscall/)
: <!-- CL 36697 -->
The new field
[`Credential.NoSetGroups`](/pkg/syscall/#Credential.NoSetGroups)
controls whether Unix systems make a `setgroups` system call
to set supplementary groups when starting a new process.
<!-- CL 36697 -->
The new field
[`Credential.NoSetGroups`](/pkg/syscall/#Credential.NoSetGroups)
controls whether Unix systems make a `setgroups` system call
to set supplementary groups when starting a new process.
<!-- CL 43512 -->
The new field
[`SysProcAttr.AmbientCaps`](/pkg/syscall/#SysProcAttr.AmbientCaps)
allows setting ambient capabilities on Linux 4.3+ when creating
a new process.
<!-- CL 43512 -->
The new field
[`SysProcAttr.AmbientCaps`](/pkg/syscall/#SysProcAttr.AmbientCaps)
allows setting ambient capabilities on Linux 4.3+ when creating
a new process.
<!-- CL 37439 -->
On 64-bit x86 Linux, process creation latency has been optimized with
use of `CLONE_VFORK` and `CLONE_VM`.
<!-- CL 37439 -->
On 64-bit x86 Linux, process creation latency has been optimized with
use of `CLONE_VFORK` and `CLONE_VM`.
<!-- CL 37913 -->
The new
[`Conn`](/pkg/syscall/#Conn)
interface describes some types in the
[`net`](/pkg/net/)
package that can provide access to their underlying file descriptor
using the new
[`RawConn`](/pkg/syscall/#RawConn)
interface.
<!-- CL 37913 -->
The new
[`Conn`](/pkg/syscall/#Conn)
interface describes some types in the
[`net`](/pkg/net/)
package that can provide access to their underlying file descriptor
using the new
[`RawConn`](/pkg/syscall/#RawConn)
interface.
<!-- syscall -->
[testing/quick](/pkg/testing/quick/)
#### [testing/quick](/pkg/testing/quick/)
: <!-- CL 39152 -->
The package now chooses values in the full range when
generating `int64` and `uint64` random
numbers; in earlier releases generated values were always
limited to the [-2<sup>62</sup>, 2<sup>62</sup>) range.
<!-- CL 39152 -->
The package now chooses values in the full range when
generating `int64` and `uint64` random
numbers; in earlier releases generated values were always
limited to the [-2<sup>62</sup>, 2<sup>62</sup>) range.
In previous releases, using a nil
[`Config.Rand`](/pkg/testing/quick/#Config.Rand)
value caused a fixed deterministic random number generator to be used.
It now uses a random number generator seeded with the current time.
For the old behavior, set `Config.Rand` to `rand.New(rand.NewSource(0))`.
In previous releases, using a nil
[`Config.Rand`](/pkg/testing/quick/#Config.Rand)
value caused a fixed deterministic random number generator to be used.
It now uses a random number generator seeded with the current time.
For the old behavior, set `Config.Rand` to `rand.New(rand.NewSource(0))`.
<!-- testing/quick -->
[text/template](/pkg/text/template/)
#### [text/template](/pkg/text/template/)
: <!-- CL 38420 -->
The handling of empty blocks, which was broken by a Go 1.8
change that made the result dependent on the order of templates,
has been fixed, restoring the old Go 1.7 behavior.
<!-- CL 38420 -->
The handling of empty blocks, which was broken by a Go 1.8
change that made the result dependent on the order of templates,
has been fixed, restoring the old Go 1.7 behavior.
<!-- text/template -->
[time](/pkg/time/)
#### [time](/pkg/time/)
: <!-- CL 36615 -->
The new methods
[`Duration.Round`](/pkg/time/#Duration.Round)
and
[`Duration.Truncate`](/pkg/time/#Duration.Truncate)
handle rounding and truncating durations to multiples of a given duration.
<!-- CL 36615 -->
The new methods
[`Duration.Round`](/pkg/time/#Duration.Round)
and
[`Duration.Truncate`](/pkg/time/#Duration.Truncate)
handle rounding and truncating durations to multiples of a given duration.
<!-- CL 35710 -->
Retrieving the time and sleeping now work correctly under Wine.
<!-- CL 35710 -->
Retrieving the time and sleeping now work correctly under Wine.
If a `Time` value has a monotonic clock reading, its
string representation (as returned by `String`) now includes a
final field `"m=±value"`, where `value` is the
monotonic clock reading formatted as a decimal number of seconds.
If a `Time` value has a monotonic clock reading, its
string representation (as returned by `String`) now includes a
final field `"m=±value"`, where `value` is the
monotonic clock reading formatted as a decimal number of seconds.
<!-- CL 44832 -->
The included `tzdata` timezone database has been
updated to version 2017b. As always, it is only used if the
system does not already have the database available.
<!-- CL 44832 -->
The included `tzdata` timezone database has been
updated to version 2017b. As always, it is only used if the
system does not already have the database available.
<!-- time -->