メインコンテンツへスキップ

Go Proposal Weekly Digest

Go言語のproposal更新を毎週お届け

Go 1.27 Release Notes

69件の変更
原文を見る (go.dev)

目次

本ページの全体要約と各項目の注釈は AI により生成されており、誤りを含む場合があります。

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.

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.

新機能メソッド宣言が独自のType Parameterを持てるようになり、ジェネリックメソッドが導入された

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 command

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.

破壊的変更cmd/go から GNU Bazaar(bzr)バージョン管理システムのサポートを削除し、bzrホストのモジュールを直接フェッチできなくする。

GODEBUG

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コマンドは、go.modやソースの//go:debugコメントで指定された削除済みGODEBUG設定が削除前の最終デフォルト値であればビルドエラーにしなくなった。

go 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が実行するデフォルトのgo vetチェック対象にstdversionが加わり、go.modのgoディレクティブより新しい標準ライブラリAPIの使用をgo test実行時に自動検出するようになった。

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 の "output" イベントに、エラー箇所を機械的に識別できる新フィールド OutputType が追加された

go doc

The go doc command now supports package@version syntax, such as go doc example.com/pkg@v1.2.3.

新機能「go doc」コマンドが `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コマンドに-exフラグが追加され、パッケージやシンボルの実行可能なexample一覧を確認できるようになった

go fix

The go fix command contains several new modernizers (atomictypes, embedlit, slicesbackward, and unsafefuncs).

新機能go fixにatomictypes・embedlit・slicesbackward・unsafefuncsの4つの新modernizerが追加された

The existing fmtappendf analyzer was removed due to stylistic concerns.

The existing waitgroup analyzer was renamed to waitgroupgo to avoid ambiguity.

破壊的変更go fixが用いるmodernizerのうち、fmtappendfアナライザをスタイル上の懸念から削除し、waitgroupアナライザを名称衝突回避のためwaitgroupgoへ改称した。

go 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ブロックに自動統合するようになった

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にポートのみ指定した場合、待ち受けアドレスがlocalhostに制限されるようになった

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 directiveがGo 1.27以降のモジュールでは、トレースバックのgoroutineヘッダー行にruntime/pprofのゴルーチンラベルが既定で表示されるようになった

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.

破壊的変更GODEBUG設定`asynctimerchan`がGo 1.27で完全に削除され、time パッケージのタイマーチャンネルは常に同期(非バッファ)動作に統一された。

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.

性能改善コンパイラがサイズ特化のメモリ割り当てルーチン呼び出しを生成し、小さいオブジェクトの割り当てを高速化

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.

新機能GC到達可能性解析でゴルーチンリークを検出する goroutineleak プロファイルが正式機能になった

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ディレクティブにおける相対ファイル名の解決を、go/scannerと同じくディレクティブを含むファイルのディレクトリ基準に変更

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.

挙動変更コンパイラがクロージャの名前をインライン化の有無によらず一意にし、複製された同一クロージャのコードをリンカ側で共有できるようにした

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 / -macsdk フラグを追加し、内部リンクモードでも LC_BUILD_VERSION の OS/SDK バージョンを指定可能にした

Standard library

New encoding/json/v2 and encoding/json/jsontext packages

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/jsontext package provides lower-level syntactic processing of JSON. The Encoder and Decoder types operate on JSON as a sequence of Token and Value, 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.

新機能挙動変更encoding/json v1の設計上の問題を刷新する新パッケージ encoding/json/v2 と encoding/json/jsontext が追加され、既存の encoding/json もv2実装に置き換わった

New crypto/mldsa package

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.

新機能post-quantum署名アルゴリズムML-DSA(FIPS 204)を実装するcrypto/mldsaパッケージを新設し、crypto/x509・crypto/tlsにもML-DSA鍵・証明書・TLS 1.3署名のサポートを追加する。

New uuid package

The new uuid package generates and parses UUIDs.

新機能標準ライブラリに UUID の生成・パースを担う uuid パッケージが新設された。

New experimental simd package

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.

新機能実験的アーキテクチャ・ベクタ幅非依存のポータブルSIMD APIを提供する simd パッケージが GOEXPERIMENT=simd の下で追加された

Experimental simd/archsimd package

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.

実験的破壊的変更実験的なsimd/archsimdパッケージがGo 1.27でAMD64向けAPIを改定しつつarm64(Neon)とWebAssemblyの128ビットSIMDに対応した

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.

新機能bytesパッケージに、セパレータの最後の出現位置でスライスを分割するCutLast関数を追加

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.

性能改善挙動変更compress/flateの圧縮速度が改善され、エンコーダ実装変更に伴いWriterの出力バイト列がGo 1.26から変化しうる

crypto

The new MLDSAMu Hash value is added for use as a signaling mechanism for External μ ML-DSA signing.

新機能crypto パッケージに、External μ ML-DSA 署名の入力が事前ハッシュ済みであることを示すセンチネル値 MLDSAMu が追加された。

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.

新機能crypto/tlsパッケージに、CNSA 2.0準拠のための鍵交換方式MLKEM1024が追加された
新機能crypto/x509とcrypto/tlsに耐量子署名アルゴリズムML-DSAのサポートが追加される。

Config.Rand is now deprecated. For deterministic testing, use testing/cryptotest.SetGlobalRandom.

非推奨crypto/tlsの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.

挙動変更Config.CurvePreferencesで明示指定したポスト量子ハイブリッド鍵交換は、tlsmlkem/tlssecpmlkem GODEBUGの値によらず有効になる

The new ConnectionState.LocalCertificate field contains the certificate chain presented to the connection peer during the handshake.

新機能`crypto/tls` の `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.

破壊的変更Go 1.27で、crypto/tls・crypto/x509のGODEBUG設定tlsunsafeekm/tlsrsakex/tls10server/tls3des/x509keypairleafの5つが完全に削除された。

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.

挙動変更crypto/x509がpkix.Nameの属性値として文字列型以外のASN.1型も受理するようになった

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.

新機能crypto/x509のCertificate・CertificateRequest・RevocationListにRawSignatureAlgorithmフィールドを追加し、未知の署名アルゴリズムでもDERエンコードされたAlgorithmIdentifierを取得できるようにする。

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がDarwinとWindowsでもSSL_CERT_FILE/SSL_CERT_DIRを尊重するようになった
新機能crypto/x509 と crypto/tls に耐量子計算機署名アルゴリズムML-DSA(FIPS 204)のサポートを追加した。

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でも文字列型の属性値は文字列としてレンダリングするようになった

database/sql

The new ConvertAssign function gives database drivers access to the type conversions performed by Rows.Scan.

新機能database/sql に Rows.Scan と同じ型変換ロジックを呼び出せる ConvertAssign 関数が追加され、ドライバが独自のスキャン実装から標準の変換ルールへフォールバックできるようになった。

database/sql/driver

Drivers may implement the new RowsColumnScanner interface to scan directly into user-provided destinations.

新機能性能改善database/sql/driverにRowsColumnScannerを追加し、ドライバがdriver.Valueを経由せず直接スキャンできるようにする

go/constant

The new StringLen function returns the length of a string Value without fully constructing the Value.

新機能go/constant パッケージに、文字列定数を実体化せずに長さを取得できる StringLen 関数を追加

go/scanner

The scanner now allows retrieving the end position of a token via the new Scanner.End method.

新機能go/scannerパッケージに、直前にスキャンしたトークンの終了位置を返すScanner.Endメソッドが追加された

go/token

File now has a String method.

新機能go/token パッケージの 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.

新機能go/types に Identical/IdenticalIgnoreTags と整合するハッシュ関数を提供する Hasher・HasherIgnoreTags を追加

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/typesは常にAlias型ノードを生成するようになった
新機能go/types のTypeParamList・TypeList・InstanceにString()メソッドを追加し、デバッグ出力の可読性を改善する

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.

新機能hash/maphashパッケージにハッシュベースのコンテナ向け共通インターフェースHasherとその標準実装ComparableHasherが追加された

The ComparableHasher type provides a convenient implementation of Hasher for comparable types where the Equal method is defined as ==.

新機能hash/maphashに、comparable型向けのHasher実装を簡単に得られるComparableHasher型が追加された

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/big.Int に丸めモードを指定できる統一除算メソッドDivideを追加。

math/rand/v2

Rand now supports a generic method N, matching the behavior of the top-level N function.

新機能math/rand/v2のRandにジェネリックメソッドNを追加し、トップレベル関数Nと同じ使い勝手をカスタムRandインスタンスでも実現した。

net

UnixConn read methods now return io.EOF directly instead of wrapping it in net.OpError when the underlying read returns EOF.

挙動変更UnixConnのReadFromUnix/ReadFrom/ReadMsgUnixが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.

新機能net/http のTransportとServerが、ConnectionState() tls.ConnectionStateを実装するnet.Conn上でもALPNによるHTTP/2ネゴシエーションを扱えるようになった

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/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がクローズ時に未読分を自動でドレインし、コネクション再利用性が向上する

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.

新機能挙動変更net/http.Server にリクエストヘッダー値の個数上限を設定できる MaxHeaderValueCount フィールドを追加し、デフォルトで500件(DefaultMaxHeaderValueCount)に制限することで、大量の小さなヘッダーを送りつけるDoS攻撃を防げるようにした。

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.

新機能net/http/httptestにインメモリネットワークとtesting.TB連携を備えた新コンストラクタNewTestServerを追加する

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.

新機能net/urlパッケージにURLとValuesを安全にディープコピーするClone()メソッドを追加

runtime/secret

Goroutines that are created while in secret mode will now themselves execute in secret mode.

挙動変更実験的runtime/secretパッケージのsecretモードが、Do配下で起動したgoroutineにも自動的に引き継がれるようになった

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.

新機能strings/bytesパッケージに、末尾から最後のセパレータで文字列を分割するCutLast関数を追加する

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でもsyscall.Errno型が定義され、error interfaceを実装するようになった

testing/synctest

The new Sleep helper function combines time.Sleep and synctest.Wait.

新機能testing/synctestパッケージに、time.Sleepとsynctest.Waitをまとめて呼ぶ便利関数Sleepを追加する

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へ更新され、Todhriなど新規スクリプトを含む最新の文字集合に対応した。

Ports

Darwin

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.27でmacOS 12のサポートが終了し、macOS 13 Ventura以降が必須になった。

PowerPC

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/ppc64(ビッグエンディアン)ポートがELFv1からELFv2システムABIへ移行し、cgo・PIE・外部リンクが利用可能になった。