Go 1.27 Release Notes
目次
Go 1.27では、長年要望されてきたジェネリックメソッドがついに言語仕様に加わり、メソッド宣言が独自の型パラメータを持てるようになったほか、構造体リテラルのキーにフィールドセレクタを使えるようにするなど言語仕様が拡張された。標準ライブラリでは、標準ライブラリ史上最大規模の改訂とも評されるencoding/json/v2とencoding/json/jsontextパッケージが新設され、既存のencoding/jsonもv2実装に置き換えられた。耐量子計算機暗号のML-DSA署名方式を実装するcrypto/mldsaパッケージ、UUIDを扱うuuidパッケージ、実験的なSIMDサポートを提供するsimdおよびsimd/archsimdパッケージも新たに追加された。ランタイムでは、Go 1.26で実験提供されていたゴルーチンリークプロファイル機能が正式機能として一般提供されるようになったほか、小さなメモリアロケーションを最大30%高速化する改善が行われた。移植面では、当初は廃止も検討されていたlinux/ppc64(ビッグエンディアン)ポートが、コミュニティの要望を受けてELFv1からELFv2へ移行する形で存続することになった。
DRAFT RELEASE NOTES — Introduction to Go 1.27はじめに(ドラフト版リリースノート)
Go 1.27 is not yet released. These are work-in-progress release notes. Go 1.27 is expected to be released in August 2026.
Go 1.27はまだリリースされていない。これは作業中のリリースノートである。 Go 1.27は2026年8月にリリースされる予定である。
Changes to the language言語仕様の変更
Go 1.27 now supports generic methods: a method declaration may declare its own type parameters. This widely anticipated change allows adding generic functions within the namespace of a particular data type where before one had to declare such functions with a scope of the entire package. Note that methods of interfaces may not declare type parameters nor can interface methods be implemented by generic methods.
Go 1.27 はジェネリックメソッドをサポートするようになった。 すなわち、メソッド宣言は独自の 型パラメータを宣言できるようになった。 この広く待ち望まれていた変更により、以前はパッケージ全体をスコープとして そうした関数を宣言する必要があった場面でも、特定のデータ型の名前空間内に ジェネリック関数を追加できるようになる。 なお、インターフェースのメソッドは型パラメータを宣言できず、 また、インターフェースのメソッドをジェネリックメソッドによって実装することもできない。
A key in a struct literal may now be any valid field selector for the struct type, not just a (top-level) field name of the struct.
Function type inference has been generalized to apply in all contexts where a generic function is assigned to a variable of (or converted to) a matching function type.
Toolsツール
Response file (@file) parsing is now supported for the compile, link, asm, cgo, cover, and pack tools.
The response file contains whitespace-separated arguments with support for single-quoted and double-quoted strings, escape sequences, and backslash-newline line continuation.
The format is compatible with GCC's response file implementation to ensure interoperability with existing build systems.
compile、link、asm、cgo、cover、packの各ツールで、レスポンスファイル(@file)の解析がサポートされるようになった。
レスポンスファイルには空白区切りの引数を記述でき、シングルクォートおよびダブルクォートで囲まれた文字列、エスケープシーケンス、バックスラッシュと改行による行継続をサポートする。
このフォーマットはGCCのレスポンスファイル実装と互換性があり、既存のビルドシステムとの相互運用性を確保している。
Go commandGo コマンド
The go command no longer has support for the bzr version control system.
It will no longer be able to directly fetch modules hosted on bzr servers.
go コマンドは bzr バージョン管理システムのサポートを持たなくなる。
bzr サーバーでホストされているモジュールを直接フェッチできなくなる。
GODEBUGGODEBUG
Starting with Go 1.27, the go command now recognizes a GODEBUG setting
for which support was removed (such as asynctimerchan, see below) if it appears in go.mod
files (godebug entries) and .go source files (//go:debug comments).
It accepts these settings if they are set to the final default value established before
the setting was removed.
If they are set to an old value, the go command will fail.
This change is in the spirit of the Go 1 compatibility guarantee
and allows existing programs that set supported GODEBUG settings to continue to
build and run without changes even when the respective setting support has been removed.
Go 1.27から、goコマンドは、サポートが削除されたGODEBUG設定(asynctimerchanなど。後述を参照)がgo.modファイル(godebugエントリ)や.goソースファイル(//go:debugコメント)に記載されている場合、それを認識するようになった。
設定がその削除前に定められた最終的なデフォルト値に設定されている場合はこれを受け入れる。
古い値に設定されている場合は、goコマンドは失敗する。
この変更はGo 1互換性保証の趣旨に沿ったものであり、サポートされているGODEBUG設定を指定している既存のプログラムが、該当する設定のサポートが削除された後も、変更なしにビルド・実行を継続できるようにするものである。
go testgo test
go test now invokes the stdversion vet check by default.
This reports the use of standard library symbols that are too new
for the Go version in force in the referring file,
as determined by go directive in go.mod and build tags on the file.
go test はデフォルトで stdversion vet チェックを呼び出すようになった。
これは、参照元ファイルで有効になっている Go のバージョンに対して新しすぎる標準ライブラリのシンボルの使用を報告するものであり、
有効な Go バージョンは go.mod 内の go ディレクティブと、そのファイルに付与されたビルドタグによって決定される。
go test -json now annotates "Action":"output" lines with an optional
new field "OutputType", specifying the type of output.
Currently, the possible values include "error", "error-continue", and "frame".
See cmd/test2json help for details.
go test -json は、オプションの新しいフィールド "OutputType" によって
"Action":"output" 行に出力の種類を注釈するようになった。
現時点で、取りうる値には "error"、"error-continue"、"frame" が含まれる。
詳細は cmd/test2json help を参照。
go docgo doc
The go doc command now supports package@version syntax, such as
go doc example.com/pkg@v1.2.3.
go doc コマンドは、go doc example.com/pkg@v1.2.3 のような package@version 構文をサポートするようになった。
The go doc command now accepts the -ex command-line option to
list executable examples of the given package or symbol.
When an example name is passed on the command line (such as
go doc bytes.ExampleBuffer), go doc now prints the example source
code along with comments.
go doc コマンドは、指定したパッケージまたはシンボルの実行可能なサンプル(example)を一覧表示するための -ex コマンドラインオプションを新たに受け付けるようになった。
コマンドラインでサンプル名(go doc bytes.ExampleBuffer など)が渡された場合、go doc はコメントとともにそのサンプルのソースコードを出力するようになった。
go fixgo fix
The go fix command contains several new modernizers (atomictypes, embedlit, slicesbackward, and unsafefuncs).
go fix コマンドには、新しいモダナイザー(atomictypes、embedlit、slicesbackward、unsafefuncs)がいくつか追加されている。
The existing fmtappendf analyzer was removed due to stylistic concerns.
The existing waitgroup analyzer was renamed to waitgroupgo to avoid ambiguity.
既存の fmtappendf アナライザーは、スタイル上の懸念から削除された。
既存の waitgroup アナライザーは、曖昧さを避けるため waitgroupgo に改名された。
go mod tidygo mod tidy
For modules specifying go 1.27 or later in their go.mod file, go mod tidy
now automatically merges duplicate require blocks. This ensures the file
maintains a clean, standard structure containing at most two require blocks:
one for direct dependencies and one for indirect dependencies.
Existing comment blocks attached to dependencies are preserved during this consolidation. If a comment block is associated with a mixed set of directives (containing both direct and indirect dependencies), the comment block is merged and attached to the new direct dependency block.
Previously, if a go.mod file accumulated multiple disjoint require blocks
(often due to manual edits, unresolved Git merge conflicts, or legacy upgrades)
go mod tidy would leave the extra blocks intact or inadvertently create new
ones. The tool now strictly enforces the two-block layout, consolidating
disparate requirements into their respective blocks and cleaning up the
structure of the module file automatically.
go.modファイルでgo 1.27以降を指定しているモジュールでは、go mod tidyが重複した
require ブロックを自動的にマージするようになった。これにより、直接依存関係用のブロック
と間接依存関係用のブロックの、最大2つの require ブロックのみを含むクリーンで標準的な
構造をファイルが維持するようになる。
この統合処理の際、依存関係に付随する既存のコメントブロックは保持される。あるコメント ブロックが直接依存関係と間接依存関係が混在するディレクティブ群に関連付けられている 場合、そのコメントブロックはマージされ、新しい直接依存関係ブロックに付与される。
これまでは、(手動編集や未解決のGitマージコンフリクト、レガシーなアップグレードなどが
原因で)go.modファイルに複数の分断された require ブロックが蓄積してしまった場合、
go mod tidyは余分なブロックをそのまま残すか、意図せず新たなブロックを作成して
しまうことがあった。このツールは今や2ブロックのレイアウトを厳密に強制するようになり、
異なる要件をそれぞれ対応するブロックへと統合し、モジュールファイルの構造を自動的に
整理する。
Traceトレース
go tool trace's -http command-line option now restricts the listen
address to localhost when passed only a port (e.g., -http=:6060).
This change makes go tool trace consistent with the behavior of
go tool pprof's -http flag.
To listen on all addresses, explicitly include the specified address
(e.g., -http=0.0.0.0:6060).
go tool traceの-httpコマンドラインオプションは、ポートのみを指定した場合(例:-http=:6060)、listenアドレスをlocalhostに制限するようになった。この変更により、go tool traceの挙動はgo tool pprofの-httpフラグと一貫性を持つようになる。すべてのアドレスでlistenするには、アドレスを明示的に指定する(例:-http=0.0.0.0:6060)。
Runtimeランタイム
Tracebacks for modules with go directives configuring Go 1.27 or later will now
include runtime/pprof goroutine labels in
the header line. This behavior can be disabled with tracebacklabels=0 GODEBUG setting
(added in Go 1.26). This opt-out is expected to be
kept indefinitely in case goroutine labels acquire sensitive information that
shouldn't be made available in tracebacks.
goディレクティブでGo 1.27以降を設定しているモジュールのトレースバックには、
ヘッダー行にruntime/pprofのgoroutineラベルが
含まれるようになる。この動作はtracebacklabels=0 GODEBUG設定
(Go 1.26で追加)によって無効化できる。このオプトアウトは、
goroutineラベルにトレースバックで公開すべきでない機微な情報が含まれるようになる
場合に備え、無期限に維持される見込みである。
The asynctimerchan GODEBUG setting (added in Go 1.23)
has been removed permanently. Channels created by package time
are now always unbuffered (synchronous), irrespective of GODEBUG settings.
asynctimerchan GODEBUG 設定(Go 1.23で追加)は完全に削除された。
time パッケージによって作成されるチャネルは、GODEBUG 設定に関わらず、
常にバッファなし(同期的)になる。
Faster memory allocationメモリアロケーションの高速化
The compiler now generates calls to size-specialized memory allocation
routines, reducing the cost of some small (<80 byte) memory allocations by
up to 30%.
Improvements vary depending on the workload, but the overall improvement is
expected to be ~1% in real allocation-heavy programs.
This causes the binary size to increase by about 60 KB (independent of the
workload).
Please file an issue if you notice any regressions.
You may set GOEXPERIMENT=nosizespecializedmalloc at build time to disable
it.
This opt-out setting is expected to be removed in Go 1.28.
コンパイラは、サイズ特化型のメモリ割り当てルーチンへの呼び出しを生成するようになり、一部の小さな(80バイト未満の)メモリ割り当てのコストを最大30%削減する。
改善幅はワークロードによって異なるが、割り当てが多い実際のプログラムでは全体として約1%の改善が見込まれる。
これにより、バイナリサイズが(ワークロードに関係なく)約60KB増加する。
退行(リグレッション)に気づいた場合は、issueを作成してください。
ビルド時に GOEXPERIMENT=nosizespecializedmalloc を設定することで、これを無効化できる。
このオプトアウト設定は、Go 1.28で削除される予定である。
Goroutine leak profileゴルーチンリークプロファイル
A new profile type that reports leaked goroutines, previously available
as an experiment in Go 1.26, is now
generally available.
The new profile type, named goroutineleak, is supported in the
runtime/pprof package.
It is also available as the net/http/pprof
endpoint /debug/pprof/goroutineleak.
A leaked goroutine is a goroutine blocked on some concurrency primitive
(channels, sync.Mutex, sync.Cond, etc)
that cannot possibly become unblocked.
The runtime detects leaked goroutines using the garbage collector: if a
goroutine G is blocked on concurrency primitive P, and P is unreachable from
any runnable goroutine or any goroutine that those could unblock, then P
cannot be unblocked, so goroutine G can never wake up.
While it is impossible to detect permanently blocked goroutines in all cases,
this approach detects a large class of such leaks.
Because this technique builds on reachability, the runtime may fail to identify leaks caused by blocking on concurrency primitives reachable through global variables or the local variables of runnable goroutines.
See Go 1.26 release notes for an example.
Special thanks to Vlad Saioc at Uber for contributing this work.
The goroutineleakprofile GOEXPERIMENT setting is now deleted.
リークしたゴルーチンを報告する新しいプロファイルタイプが、一般提供された。これは以前、Go 1.26において実験的機能として利用可能だったものである。この新しいプロファイルタイプは goroutineleak という名前を持ち、runtime/pprof パッケージでサポートされる。また、net/http/pprof のエンドポイント /debug/pprof/goroutineleak としても利用可能である。
リークしたゴルーチンとは、何らかの同期プリミティブ(チャネル、sync.Mutex、sync.Cond など)でブロックされ、二度とブロック解除されることがないゴルーチンのことである。ランタイムは、ガベージコレクタを用いてリークしたゴルーチンを検出する。すなわち、ゴルーチンGが同期プリミティブPでブロックされており、Pが実行可能な任意のゴルーチンからも、それらのゴルーチンがブロック解除しうる任意のゴルーチンからも到達不可能である場合、Pはブロック解除されることがなく、したがってゴルーチンGは二度と目覚めることがない。すべてのケースで永久にブロックされたゴルーチンを検出することは不可能だが、このアプローチはそうしたリークの大部分のクラスを検出する。
この手法は到達可能性解析に基づいているため、グローバル変数や実行可能なゴルーチンのローカル変数を経由して到達可能な同期プリミティブでのブロックが原因のリークについては、ランタイムが検出できない場合がある。
例については Go 1.26のリリースノート を参照のこと。
この成果に貢献してくれたUberのVlad Saiocに特に感謝する。
goroutineleakprofile GOEXPERIMENT 設定は、現在は削除されている。
Compilerコンパイラ
The compiler now resolves a relative filename in a //line or /*line*/
directive against the directory of the file containing the directive,
matching the behavior of go/scanner.
Absolute filenames are unaffected.
See #70478.
コンパイラは、//line または /*line*/ ディレクティブ中の相対ファイル名を、
そのディレクティブを含むファイルのディレクトリを基準に解決するようになった。
これは go/scanner の挙動に合わせたものである。
絶対ファイル名は影響を受けない。
#70478 を参照。
The compiler now generates simpler names for function literals (closures). Previously, when the containing function is inlined, the function literal's name can get quite long. Now the compiler chooses the same name for the function literal regardless of inlining. It may also combine multiple instances of the same function literal (as its containing function is inlined) to share the same code in the compiled binary. This change does not affect the functionality of Go code. Tests that check symbol names may need update, although it is recommended to not depend on the names of function literals. For programs that incorrectly compare function code pointer for equality, the issue may be more exposed with Go 1.27, as function literals with different captured closure data may have equal code pointers in more cases.
コンパイラは、関数リテラル(クロージャ)に対してより単純な名前を生成するようになった。 以前は、それを含む関数がインライン化されると、関数リテラルの名前がかなり長くなることがあった。 今では、インライン化されるかどうかにかかわらず、コンパイラは関数リテラルに対して同じ名前を選ぶ。 また、同じ関数リテラルの複数のインスタンス(それを含む関数がインライン化されることで生じる)をまとめて、コンパイル済みバイナリ内で同一のコードを共有することもある。 この変更はGoコードの機能には影響しない。 シンボル名を検査するテストは更新が必要になる場合があるが、関数リテラルの名前に依存しないことが推奨される。 関数のコードポインタを等価性比較のために誤って使用しているプログラムでは、Go 1.27でこの問題がより顕在化するおそれがある。捕捉されたクロージャのデータが異なる関数リテラル同士でも、より多くのケースでコードポインタが等しくなり得るためだ。
Linkerリンカ
When targeting macOS, the linker now accepts -macos and -macsdk
command-line options, which specify the OS and SDK versions in the
LC_BUILD_VERSION load command.
By default, it selects the oldest supported macOS version (currently
13.0.0) and a recent SDK version (currently 26.2.0).
macOSをターゲットとする場合、リンカは新たに -macos および -macsdk
コマンドラインオプションを受け付けるようになった。これらは
LC_BUILD_VERSION ロードコマンドに設定するOSバージョンとSDKバージョンを
指定するものである。デフォルトでは、サポートされる最も古いmacOSバージョン(現在は
13.0.0)と、比較的新しいSDKバージョン(現在は26.2.0)が選択される。
Standard library標準ライブラリ
New encoding/json/v2 and encoding/json/jsontext packages新しい encoding/json/v2 と encoding/json/jsontext パッケージ
Two new packages are now available:
The encoding/json/v2 package is a major
revision of encoding/json. It provides
Marshal,
MarshalWrite,
MarshalEncode,
Unmarshal,
UnmarshalRead, and
UnmarshalDecode,
all of which accept variadic Options
arguments to configure marshaling and unmarshaling behavior.
- The
encoding/json/jsontextpackage provides lower-level syntactic processing of JSON. TheEncoderandDecodertypes operate on JSON as a sequence ofTokenandValue, maintaining a state machine to ensure the produced or consumed sequence is valid JSON text.
The v2 package chooses stricter, more interoperable defaults than v1:
it rejects invalid UTF-8 in JSON strings and rejects duplicate names within
a JSON object. See the v1 encoding/json package
documentation for the complete set of behavioral differences and
the options available to adjust them.
The encoding/json package is now backed by the
v2 implementation. Marshaling and unmarshaling behavior is preserved, but
the exact text of error messages may differ. The package also gains a number of
new Options that can configure v2 to operate
with v1 semantics to avoid requiring a full migration to the new API.
The v1 API will continue to be supported and users are not required to migrate.
Marshal performance is broadly at parity with the previous implementation, while unmarshal performance is significantly faster.
Users who encounter compatibility problems with the new implementation
may disable it by setting GOEXPERIMENT=nojsonv2 at build time,
restoring the original v1 implementation.
This opt-out is expected to be removed in a future release.
See the proposal issue for background and additional detail. If you need to disable the new implementation, please file an issue.
2つの新しいパッケージが利用可能になった。
encoding/json/v2 パッケージは
encoding/json のメジャーリビジョンである。
Marshal、
MarshalWrite、
MarshalEncode、
Unmarshal、
UnmarshalRead、および
UnmarshalDecode を提供し、
これらはすべてマーシャリングおよびアンマーシャリングの挙動を設定するために
可変長の Options 引数を受け取る。
encoding/json/jsontextパッケージは JSONのより低レベルな構文処理を提供する。Encoder型とDecoder型は、JSONをTokenとValueの並びとして扱い、 生成または消費される並びが妥当なJSONテキストであることを保証するために 状態機械を維持する。
v2パッケージはv1よりも厳格で、より相互運用性の高いデフォルトを選択する。
JSON文字列中の不正なUTF-8を拒否し、JSONオブジェクト内の重複した名前を拒否する。
挙動の違いの完全な一覧とそれらを調整するために利用可能なオプションについては、
v1の encoding/json パッケージの
ドキュメントを参照のこと。
encoding/json パッケージは現在v2実装によって
支えられている。マーシャリングおよびアンマーシャリングの挙動は維持されるが、
エラーメッセージの正確な文言は異なる場合がある。このパッケージはまた、
新API全体への完全な移行を必要とせずにv2をv1のセマンティクスで動作させるよう
設定できる、いくつかの新しい Options を得た。
v1 APIは引き続きサポートされ、ユーザーは移行を強制されない。
Marshalの性能は従来の実装とおおむね同等であり、一方でUnmarshalの性能は 大幅に高速化されている。
新実装との互換性の問題に遭遇したユーザーは、ビルド時に
GOEXPERIMENT=nojsonv2 を設定することでこれを無効化し、元のv1実装に
戻すことができる。このオプトアウトは将来のリリースで削除される予定である。
背景と追加の詳細については proposal issue を参照のこと。 新実装を無効化する必要がある場合は、issueを提出してほしい。
New crypto/mldsa package新しい crypto/mldsa パッケージ
The new crypto/mldsa package implements the post-quantum ML-DSA signature
scheme specified in FIPS 204.
crypto/x509 now supports ML-DSA private keys, public keys, and signatures.
crypto/tls now supports ML-DSA signatures in TLS 1.3, with the new
MLDSA44, MLDSA65,
and MLDSA87 SignatureScheme values.
新しいcrypto/mldsaパッケージは、FIPS 204で規定されているポスト量子ML-DSA署名方式を実装する。
crypto/x509は、ML-DSAの秘密鍵、公開鍵、署名をサポートするようになった。
crypto/tlsは、TLS 1.3におけるML-DSA署名をサポートするようになり、新たにMLDSA44、MLDSA65、MLDSA87のSignatureScheme値が追加された。
New uuid package新しい uuid パッケージ
The new uuid package generates and parses UUIDs.
新しいuuidパッケージは、UUIDの生成とパースを行う。
New experimental simd package新しい実験的な simd パッケージ
Go 1.27 introduces a new experimental simd
package that provides portable and vector-size-agnostic SIMD
support. It will make use of the hardware instructions
if they are available.
This package is enabled by setting the environment variable
GOEXPERIMENT=simd at build time.
The simd package is available on all architectures, and provides
vector types of unspecified size such as Int8s and Float32s.
It supports a "scalable" subset of the operations present in the
simd/archsimd package
that are hardware-supported or easily emulated across architectures
and vector widths.
See the proposal issue for more details.
Go 1.27では、移植性がありベクトルサイズに依存しないSIMDサポートを提供する、新しい実験的なsimd
パッケージが導入される。利用可能な場合はハードウェア命令を
使用する。
このパッケージは、ビルド時に環境変数
GOEXPERIMENT=simdを設定することで有効になる。
simdパッケージはすべてのアーキテクチャで利用可能であり、Int8sやFloat32sのような、
サイズを指定しないベクトル型を提供する。
これは、simd/archsimdパッケージに存在する操作のうち、
アーキテクチャやベクトル幅をまたいでハードウェアでサポートされているか
容易にエミュレートできるものの「スケーラブル」な部分集合をサポートする。
詳細についてはproposal issueを参照。
Experimental simd/archsimd package実験的な simd/archsimd パッケージ
Go 1.27 continues the experimental support for SIMD operations in
the simd/archsimd package that began in Go 1.26.
This release revises the amd64 API and adds support for arm64 "Neon" 128-bit SIMD and WebAssembly 128-bit SIMD.
The simd/archsimd package is enabled by setting the environment variable
GOEXPERIMENT=simd at build time.
This package provides access to architecture-specific SIMD operations. It supports 128-bit vector types on wasm, arm64, and amd64, and 256-bit and 512-bit vector types on some amd64 processors. The API is not yet considered stable.
See the package documentation and the proposal issue for more details.
We intend to provide support for additional architectures in future versions, but the API is intentionally architecture-specific and thus non-portable.
Go 1.27では、Go 1.26で始まったsimd/archsimdパッケージにおけるSIMD操作の実験的サポートを継続する。
本リリースではamd64のAPIを改訂し、arm64の「Neon」128ビットSIMDおよびWebAssemblyの128ビットSIMDのサポートを追加する。
simd/archsimdパッケージは、ビルド時に環境変数GOEXPERIMENT=simdを設定することで有効になる。
このパッケージは、アーキテクチャ固有のSIMD操作へのアクセスを提供する。 wasm、arm64、amd64では128ビットのベクター型を、 一部のamd64プロセッサでは256ビットおよび512ビットのベクター型をサポートする。 このAPIはまだ安定版とはみなされていない。
詳細については、パッケージドキュメントおよび提案のissueを参照のこと。
今後のバージョンで追加のアーキテクチャのサポートを提供する予定であるが、 このAPIは意図的にアーキテクチャ固有であり、そのため移植性がない。
Minor changes to the libraryライブラリのその他の変更
bytes
The new CutLast function slices a []byte
around the last occurrence of a separator.
It can replace and simplify some common uses of LastIndex.
compress/flate
Compression speed is improved in Go 1.27.
The exact encoded output from Writer may be different from Go 1.26
as a result of the encoder implementation change.
Since DEFLATE is the underlying compression used in archive/zip, compress/gzip, compress/zlib, and image/png,
the outputs from those packages may also have changed.
Go 1.27では圧縮速度が改善された。
エンコーダの実装変更の結果として、Writer の正確なエンコード出力は
Go 1.26と異なる場合がある。
DEFLATEはarchive/zip、compress/gzip、compress/zlib、image/pngで使われている基盤の圧縮方式であるため、
これらのパッケージの出力も変化している可能性がある。
crypto
crypto/ecdsa
PrivateKey.Sign now checks that the length of the hash is correct,
if a non-nil SignerOpts is provided.
PrivateKey.Signは、非nilのSignerOptsが指定されている場合、
ハッシュの長さが正しいかどうかをチェックするようになった。
crypto/tls
The new QUICConfig.ClientHelloInfoConn field specifies the net.Conn to use
for the ClientHelloInfo.Conn field during QUIC server handshakes.
新しい QUICConfig.ClientHelloInfoConn フィールドは、QUICサーバーのハンドシェイク中に
ClientHelloInfo.Conn フィールドに使用する net.Conn を指定する。
The MLKEM1024 key exchange is now supported. It can be enabled by adding it to
Config.CurvePreferences.
MLKEM1024 鍵交換がサポートされるようになった。
Config.CurvePreferences に追加することで有効にできる。
Config.Rand is now deprecated.
For deterministic testing, use testing/cryptotest.SetGlobalRandom.
Config.Rand は非推奨となった。
決定的なテストを行うには、testing/cryptotest.SetGlobalRandom を使用する。
Post-quantum hybrid key exchanges can now be explicitly enabled in
Config.CurvePreferences even if the tlsmlkem=0 or tlssecpmlkem=0 GODEBUG
options are used. Those options were always meant to only apply to the default
set used when Config.CurvePreferences is nil.
ポスト量子ハイブリッド鍵交換は、tlsmlkem=0 または tlssecpmlkem=0 の GODEBUG
オプションが使用されている場合でも、Config.CurvePreferences で明示的に有効にできるようになった。これらの
オプションは、Config.CurvePreferences が nil の場合に使用されるデフォルトの
セットにのみ適用されることが常に意図されていた。
The new ConnectionState.LocalCertificate
field contains the certificate chain presented to the connection peer during the handshake.
新しいConnectionState.LocalCertificate
フィールドは、ハンドシェイク中に接続相手に提示された証明書チェーンを保持する。
The tlsunsafeekm (added in Go 1.22),
tlsrsakex (added in Go 1.22),
tls3des (added in Go 1.23),
tls10server (added in Go 1.22),
and x509keypairleaf (added in Go 1.23)
GODEBUG settings have been removed permanently.
tlsunsafeekm(Go 1.22で追加)、
tlsrsakex(Go 1.22で追加)、
tls3des(Go 1.23で追加)、
tls10server(Go 1.22で追加)、
およびx509keypairleaf(Go 1.23で追加)の各
GODEBUG設定は完全に削除された。
crypto/x509
When parsing into pkix.Name fields,
a wider range of pkix.AttributeTypeAndValue.Value
types is now supported, and unknown types are parsed into
asn1.RawValue.
pkix.Name のフィールドへパースする際、
より広い範囲のpkix.AttributeTypeAndValue.Value
型がサポートされるようになり、未知の型は
asn1.RawValue としてパースされるようになった。
The new Certificate.RawSignatureAlgorithm, CertificateRequest.RawSignatureAlgorithm,
and RevocationList.RawSignatureAlgorithm fields expose the DER-encoded
AlgorithmIdentifier of the signature algorithm, including when the
SignatureAlgorithm field is UnknownSignatureAlgorithm.
新しい Certificate.RawSignatureAlgorithm、CertificateRequest.RawSignatureAlgorithm、
および RevocationList.RawSignatureAlgorithm フィールドは、署名アルゴリズムのDERエンコードされた
AlgorithmIdentifierを公開する。これは、SignatureAlgorithmフィールドが
UnknownSignatureAlgorithmである場合も含む。
SystemCertPool now respects SSL_CERT_FILE and SSL_CERT_DIR on Windows and
Darwin. When these environment variables are set, roots are loaded from disk and
instead of using the platform certificate verification APIs, the native Go
verifier is used. This behavior can be disabled with
GODEBUG=x509sslcertoverrideplatform=0.
SystemCertPool は、WindowsおよびDarwinにおいてもSSL_CERT_FILEとSSL_CERT_DIRを
尊重するようになった。これらの環境変数が設定されている場合、プラットフォームの証明書検証APIを使う
代わりに、ディスクからルート証明書が読み込まれ、Goネイティブの
検証器が使用される。この挙動は
GODEBUG=x509sslcertoverrideplatform=0 によって無効化できる。
crypto/x509/pkix
RDNSequence.String (and therefore Name.String) now renders string-typed
attribute values as strings even when the attribute's OID is unrecognized.
Previously such values were always hex-encoded in their DER form.
See #33093.
RDNSequence.String(そしてそれゆえにName.String)は、属性のOIDが認識されない場合でも
文字列型の属性値を文字列としてレンダリングするようになった。
以前は、そのような値は常にDER形式で16進エンコードされていた。
#33093を参照。
database/sql
The new ConvertAssign function gives database drivers access
to the type conversions performed by Rows.Scan.
新しいConvertAssign関数により、データベースドライバはRows.Scanが行う型変換にアクセスできるようになった。
database/sql/driver
Drivers may implement the new RowsColumnScanner interface
to scan directly into user-provided destinations.
ドライバーは、ユーザーが指定したdestinationに直接スキャンするために、新しいRowsColumnScannerインターフェースを実装できる。
go/constant
The new StringLen function returns
the length of a string Value without
fully constructing the Value.
go/scanner
The scanner now allows retrieving the end position of a token via the new Scanner.End method.
スキャナは、新しいScanner.Endメソッドによって、トークンの終了位置を取得できるようになった。
go/token
File now has a String method.
File には新たに String メソッドが追加された。
go/types
The Hasher type is an implementation of
maphash.Hasher for Types
that respects the Identical equivalence relation, allowing Types
to be used in hash tables and similar data structures.
HasherIgnoreTags is the analogous hasher for IdenticalIgnoreTags.
Hasher 型は、Identical 同値関係に従う形で
Type 向けに maphash.Hasher を実装したものであり、Types
をハッシュテーブルなどのデータ構造で使用できるようにする。
HasherIgnoreTags は、IdenticalIgnoreTags に対応する同様のハッシャーである。
The gotypesalias GODEBUG setting (added in Go 1.22)
has been removed permanently and the package go/types
now always produces an Alias type node for
alias declarations irrespective of GODEBUG settings.
gotypesalias GODEBUG 設定(Go 1.22で追加)は完全に削除され、パッケージgo/typesはGODEBUGの設定に関わらず、エイリアス宣言に対して常にAlias型ノードを生成するようになった。
hash/maphash
The Hasher interface type defines the contract between values of a
particular type and future hash-based data structures such as hash
tables and Bloom filters; see #70471.
The ComparableHasher type provides a
convenient implementation of Hasher for
comparable types where the Equal method is defined as ==.
ComparableHasher 型は、Equal メソッドが
== として定義されているcomparableな型向けに、
Hasher の便利な実装を提供する。
math/big
Int now has a Divide method
to compute quotient and remainder of two Int values.
It supports rounding modes Trunc, Floor,
Round, and Ceil.
math/rand/v2
net
UnixConn read methods now return io.EOF directly instead of wrapping it in net.OpError when the underlying read returns EOF.
UnixConn の read メソッドは、基盤となる read が EOF を返した場合、net.OpError でラップするのではなく、io.EOF を直接返すようになった。
net/http
Transport and Server support TLS ALPN protocol negotiation on
user-provided net.Conn connections which implement a
ConnectionState() tls.ConnectionState method.
Transport と Server は、ConnectionState() tls.ConnectionState メソッドを実装するユーザー提供の net.Conn 接続上でのTLS ALPNプロトコルネゴシエーションをサポートする。
HTTP/2 server now accepts client priority signals, as defined in RFC 9218,
allowing it to prioritize serving HTTP/2 streams with higher priority. If the
old behavior is preferred, where streams are served in a round-robin manner
regardless of priority, Server.DisableClientPriority can be set to true.
HTTP/2サーバーは、RFC 9218で定義されているクライアントの優先度シグナルを受け付けるようになり、より優先度の高いHTTP/2ストリームを優先して配信できるようになった。優先度に関係なくストリームをラウンドロビン方式で配信する従来の挙動を維持したい場合は、Server.DisableClientPriorityをtrueに設定すればよい。
HTTP/1 Response.Body now automatically drains any unread content upon being
closed, up to a conservative limit, to allow better connection reuse. For most
programs, this change should be a no-op, or result in a performance improvement.
In rare cases, programs that do not benefit from connection reuse might
experience performance degradation if they had been improperly allowing an
excessive amount of idle connections to linger; usually by setting
Transport.MaxIdleConns to 0 or using different Clients for different
requests, thereby bypassing Transport.MaxIdleConns limit. In these cases,
setting Transport.DisableKeepAlives to true will disable connection reuse.
However, such performance degradation usually indicates improper configuration
or usage of Transport or Client in the first place, and a deeper look would
likely be beneficial.
HTTP/1のResponse.Bodyは、より良いコネクション再利用を可能にするため、クローズされた際に未読の内容を保守的な上限まで自動的に読み捨てるようになった。ほとんどのプログラムにとって、この変更は無害であるか、性能向上をもたらすはずである。まれなケースとして、コネクション再利用の恩恵を受けないプログラムが、アイドル状態のコネクションを不適切に大量に残留させていた場合(通常はTransport.MaxIdleConnsを0に設定するか、リクエストごとに異なるClientを使用することでTransport.MaxIdleConnsの上限を回避していた場合)、性能が低下することがある。このような場合には、Transport.DisableKeepAlivesをtrueに設定することでコネクション再利用を無効化できる。しかし、このような性能低下は通常、そもそもTransportやClientの設定や使用方法が適切でないことを示しており、より深く調査する価値があるだろう。
The new Server.MaxHeaderValueCount
field allows HTTP servers to control the number of header values that they are
willing to accept. If unset,
DefaultMaxHeaderValueCount is
used.
新しいServer.MaxHeaderValueCountフィールドにより、HTTPサーバーは受け入れるヘッダー値の数を制御できるようになる。未設定の場合はDefaultMaxHeaderValueCountが使用される。
net/http/httptest
The new NewTestServer function
creates a Server configured to use an in-memory
fake network suitable for use with the testing/synctest package.
新しい NewTestServer 関数は、testing/synctest パッケージでの使用に適した、インメモリのフェイクネットワークを使用するよう設定された Server を作成する。
net/url
The new URL.Clone method creates a deep copy of a URL.
The new Values.Clone method creates a deep copy of Values.
新しいURL.Cloneメソッドは、URLのディープコピーを作成する。
新しいValues.Cloneメソッドは、Valuesのディープコピーを作成する。
runtime/secret
Goroutines that are created while in secret mode will now themselves execute in secret mode.
secret mode中に作成されたgoroutineは、 今後はそれ自体もsecret mode内で実行されるようになる。
strings
The new CutLast function slices a string
around the last occurrence of a separator.
It can replace and simplify some common uses of LastIndex.
syscall
On Plan 9, the Errno type is now defined and
implements the error interface, as on other platforms. Plan 9 system
calls return ErrorString values, so Errno is never returned by this
package on Plan 9. It is defined so that portable code referring to
syscall.Errno builds on Plan 9 without build constraints.
Plan 9において、Errno 型が、他のプラットフォームと同様に定義され、error インターフェースを実装するようになった。Plan 9のシステムコールは ErrorString 値を返すため、このパッケージがPlan 9上で Errno を返すことはない。syscall.Errno を参照するポータブルなコードがビルド制約なしにPlan 9上でビルドできるように、この型は定義されている。
testing/synctest
The new Sleep helper function combines time.Sleep and synctest.Wait.
新しいSleepヘルパー関数は、time.Sleepとsynctest.Waitを組み合わせたものである。
unicode
The unicode package and associated support throughout the system have been upgraded from Unicode 15 to Unicode 17. See the Unicode 16.0.0 and Unicode 17.0.0 release notes for information about the changes.
unicodeパッケージおよびシステム全体における関連サポートは、Unicode 15からUnicode 17へアップグレードされた。 変更内容についてはUnicode 16.0.0および Unicode 17.0.0 のリリースノートを参照のこと。
Ports移植
DarwinDarwin
As announced in the Go 1.26 release notes, Go 1.27 requires macOS 13 Ventura or later; support for previous versions has been discontinued.
Go 1.26 リリースノートで案内したとおり、 Go 1.27 は macOS 13 Ventura 以降を必要とする。 それより前のバージョンのサポートは終了した。
PowerPCPowerPC
On the big-endian 64-bit PowerPC port on Linux (GOOS=linux GOARCH=ppc64),
the Go toolchain now generates binaries that use the ELFv2
system ABI.
ELFv2 support requires Linux kernel 3.13 or later.
RHEL7 backported this support to its 3.10 kernel.
Cgo, position-independent executables (PIE), and external linking are now supported. Using these features requires an ELFv2 compatible runtime (libc and all linked and loaded libraries).
For programs that do not use cgo, the Go toolchain still
generates static binaries with internal linking by default.
For programs that have cgo options, if a static, pure-Go binary
is needed, one can set the environment variable CGO_ENABLED=0
when running go build.
Linux上のビッグエンディアン64ビットPowerPCポート(GOOS=linux GOARCH=ppc64)において、
Goツールチェーンは now ELFv2
system ABIを使用するバイナリを生成するようになった。
ELFv2のサポートにはLinuxカーネル3.13以降が必要である。
RHEL7はこのサポートを3.10カーネルにバックポートしている。
Cgo、位置独立実行ファイル(PIE)、および外部リンクが サポートされるようになった。 これらの機能を使用するには、ELFv2互換のランタイム (libcおよびリンク・ロードされるすべてのライブラリ)が必要である。
cgoを使用しないプログラムについては、Goツールチェーンはデフォルトで
引き続き内部リンクによる静的バイナリを生成する。
cgoオプションを持つプログラムについて、静的な純粋Goバイナリ
が必要な場合は、go build実行時に環境変数CGO_ENABLED=0を
設定すればよい。