Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

[インデックス 17004] ファイルの概要

このコミットは、Go言語の標準ライブラリの次期リリースで導入される予定のAPI変更を記録するapi/next.txtファイルを更新するものです。api/next.txtは、GoのAPI互換性ポリシーに則り、将来のリリースで追加または変更される公開APIのリストを管理するために使用されます。このファイルへの変更は、Goの進化と新機能の追加を反映しています。

コミット

commit 869774cbf9025b8553b490c9add568d459cd4d63
Author: Brad Fitzpatrick <bradfitz@golang.org>
Date:   Fri Aug 2 13:15:49 2013 -0700

    api: update next.txt
    
    R=golang-dev, rsc
    CC=golang-dev
    https://golang.org/cl/12360043

GitHub上でのコミットページへのリンク

https://github.com/golang/go/commit/869774cbf9025b8553b490c9add568d459cd4d63

元コミット内容

api: update next.txt

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12360043

変更の背景

Go言語は、後方互換性を非常に重視しています。これは、既存のGoプログラムが新しいバージョンのGoコンパイラやライブラリでも引き続き動作することを保証するためです。この互換性ポリシーを維持するために、Goプロジェクトでは公開APIの変更を厳密に管理しています。

api/next.txtファイルは、このAPI互換性チェックの重要な一部です。Goのリリースプロセスでは、新しいAPIが追加される前にこのファイルにそのAPIが記述されます。これにより、開発者は次期リリースでどのようなAPIが利用可能になるかを事前に確認でき、また、APIレビュープロセスにおいて、追加されるAPIがGoの設計原則と互換性ポリシーに準拠しているかどうかが確認されます。

このコミットは、Goの次期リリース(当時のGo 1.2リリースサイクル中)に向けて、様々なパッケージで導入される新しい関数、メソッド、型、定数などをapi/next.txtに反映させるために行われました。これにより、Goの標準ライブラリが機能的に拡張され、より多くのユースケースに対応できるようになります。

前提知識の解説

GoのAPI互換性ポリシー

Go言語は「Go 1互換性保証」という強力なポリシーを持っています。これは、Go 1.xのリリース間で、既存のGoプログラムが新しいGoバージョンでコンパイルされ、実行されることを保証するものです。この保証は、Goの採用を促進し、開発者が安心してGoのバージョンアップを行えるようにするために不可欠です。

API互換性保証の主な側面は以下の通りです。

  • 既存の公開APIの変更禁止: Go 1で公開されたAPIは、原則として変更または削除されません。
  • 新しいAPIの追加: 新しい機能は、既存のAPIを変更することなく、新しい関数、メソッド、型、定数として追加されます。
  • api/next.txtの役割: 新しい公開APIは、正式にリリースされる前にapi/next.txtにリストアップされます。これにより、APIの追加がレビューされ、互換性ポリシーに違反していないか確認されます。また、このファイルは、APIチェッカーツールによって、実際のコードとapi/next.txtの内容が一致しているかどうかの検証にも使用されます。

Goの標準ライブラリ

Goの標準ライブラリは、Go言語の強力な特徴の一つです。ネットワーキング、暗号化、ファイルI/O、データ構造、画像処理など、幅広い機能を提供します。これらのライブラリはGo言語自体と同じく、高い品質とパフォーマンス、そして互換性を維持するように設計されています。

各パッケージの役割(コミットで言及されているもの)

  • container/list: 双方向リンクリストを実装するパッケージ。
  • crypto: 暗号化のプリミティブを提供するパッケージ。
  • crypto/md5, crypto/sha1, crypto/sha256, crypto/sha512: 各種ハッシュアルゴリズムの実装を提供するパッケージ。
  • crypto/rsa: RSA暗号の実装を提供するパッケージ。
  • crypto/subtle: サイドチャネル攻撃を防ぐための定数時間操作を提供するパッケージ。
  • crypto/tls: TLS (Transport Layer Security) プロトコルの実装を提供するパッケージ。
  • crypto/x509: X.509証明書とPKIX (Public Key Infrastructure X.509) の実装を提供するパッケージ。
  • flag: コマンドライン引数をパースするためのパッケージ。
  • go/ast: Goのソースコードの抽象構文木 (AST) を表現するパッケージ。
  • go/build: Goのパッケージビルドプロセスに関する情報を提供するパッケージ。
  • image/color: 色の表現と変換に関する型と関数を提供するパッケージ。
  • image/draw: 画像の描画操作(合成、変換など)を行うためのインターフェースと実装を提供するパッケージ。
  • image/gif: GIF画像のエンコードとデコードを行うパッケージ。
  • log/syslog: システムログ(syslog)への書き込み機能を提供するパッケージ。
  • net: ネットワークI/Oのプリミティブを提供するパッケージ。
  • net/smtp: SMTP (Simple Mail Transfer Protocol) クライアントの実装を提供するパッケージ。
  • reflect: 実行時のリフレクション機能を提供するパッケージ。
  • sort: ソートアルゴリズムを提供するパッケージ。
  • strings: 文字列操作のための関数を提供するパッケージ。
  • syscall: オペレーティングシステム固有のシステムコールへの低レベルなインターフェースを提供するパッケージ。
  • testing: Goのテストフレームワークを提供するパッケージ。特に、コードカバレッジ機能に関連する変更が含まれています。
  • unicode: Unicode文字のプロパティに関する関数を提供するパッケージ。

技術的詳細

このコミットは、api/next.txtに多数の新しいAPIエントリを追加しています。これらのエントリは、Goの標準ライブラリの様々な領域における機能拡張を示しています。

暗号化とセキュリティ関連の強化

  • crypto.PublicKey インターフェース: 汎用的な公開鍵インターフェースの導入は、暗号化パッケージにおける公開鍵の抽象化を強化し、より柔軟な鍵管理と操作を可能にします。
  • ハッシュ関数の追加: crypto/md5, crypto/sha1, crypto/sha256, crypto/sha512 パッケージに、バイトスライスから直接ハッシュ値を計算するSum関数が追加されています。これにより、ハッシュ計算の利便性が向上します。
  • TLS 1.2のサポートと新しいCipher Suite: crypto/tlsパッケージにVersionTLS12定数が追加され、TLS 1.2プロトコルのサポートが明示されます。また、TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHAなどの新しいECDHE-ECDSAベースのCipher Suiteが追加され、より強力でモダンな暗号化通信の選択肢が提供されます。これは、前方秘匿性(Forward Secrecy)を提供するECDHE(Elliptic Curve Diffie-Hellman Ephemeral)鍵交換と、ECDSA(Elliptic Curve Digital Signature Algorithm)による認証を組み合わせたもので、セキュリティの向上に寄与します。
  • X.509証明書の拡張情報: crypto/x509.Certificate構造体にCRLDistributionPoints, IssuingCertificateURL, OCSPServerといったフィールドが追加されています。これらは、証明書失効リスト(CRL)の配布点、発行元証明書のURL、OCSP(Online Certificate Status Protocol)サーバーのURLなど、証明書の検証と管理に重要な情報を提供します。これにより、証明書の検証プロセスがより堅牢になります。

画像処理の改善

  • image/drawパッケージの拡張: DrawerおよびQuantizerインターフェースの導入、FloydSteinberg変数の追加、Op型のDrawメソッドの追加は、Goの画像描画機能の柔軟性と拡張性を大幅に向上させます。特に、Drawerインターフェースは、様々な描画操作を抽象化し、カスタム描画ロジックの実装を容易にします。Quantizerは、色の量子化(色数を減らす処理)をカスタマイズするためのインターフェースです。FloydSteinbergは、ディザリングアルゴリズムの一種で、限られた色数で画像をより自然に見せるために使用されます。
  • image/gifパッケージの機能強化: EncodeAll関数と、Options構造体へのDrawer, NumColors, Quantizerフィールドの追加は、GIF画像のエンコードプロセスをより細かく制御できるようにします。これにより、アニメーションGIFの生成や、特定の色パレットと量子化アルゴリズムを使用したGIFの作成が可能になります。

リフレクションとシステムコール

  • reflect.Valueの新しいメソッド: SetCapSlice3メソッドは、リフレクションAPIを通じてスライスをより柔軟に操作できるようにします。SetCapはスライスの容量を設定し、Slice3は3つのインデックス(開始、終了、容量)を指定してスライスを作成する機能を提供します。これらは、動的なデータ構造操作において強力なツールとなります。
  • syscallパッケージのプラットフォーム固有の拡張: Dup3(Linux)、SetsockoptByte(Linux)、Syscall9(Darwin)などのシステムコールが追加されています。これらは、特定のオペレーティングシステム上で低レベルな操作を行うためのもので、例えばDup3は既存のファイルディスクリプタを複製し、新しいディスクリプタに割り当てることができます。SetsockoptByteはソケットオプションをバイト値で設定します。Syscall9は、9つの引数を取るシステムコールを呼び出すための汎用的な関数です。これらの追加は、Goがより低レベルなシステムプログラミングのニーズに対応できるようにするためのものです。

その他の注目すべき変更

  • container/listMoveAfter/MoveBefore: リンクリストの要素を特定の位置に移動させるための便利なメソッドが追加され、リスト操作の効率が向上します。
  • flag.Getterインターフェース: コマンドラインフラグの値を取得するための汎用的なインターフェースが導入され、カスタムフラグ型の実装がより容易になります。
  • testing.RegisterCoverと関連型: Goのコードカバレッジツールに関連するAPIが追加されています。これは、Goのテストフレームワークがコードカバレッジ情報を収集し、報告するための内部メカニズムを公開するものです。これにより、サードパーティのツールがGoのカバレッジデータと連携できるようになる可能性があります。

コアとなるコードの変更箇所

このコミットのコアとなる変更は、api/next.txtファイルへの追記です。このファイルは、GoのAPIチェッカーが次期リリースで許可されるAPIの変更を検証するために使用する、正規のAPIリストです。

--- a/api/next.txt
+++ b/api/next.txt
@@ -1,20 +1,56 @@
+pkg container/list, method (*List) MoveAfter(*Element, *Element)
+pkg container/list, method (*List) MoveBefore(*Element, *Element)
+pkg crypto, type PublicKey interface {}
+pkg crypto/md5, func Sum([]uint8) [Size]uint8
 pkg crypto/rsa, const PSSSaltLengthAuto ideal-int
 pkg crypto/rsa, const PSSSaltLengthEqualsHash ideal-int
 pkg crypto/rsa, func SignPSS(io.Reader, *PrivateKey, crypto.Hash, []uint8, *PSSOptions) ([]uint8, error)
 pkg crypto/rsa, func VerifyPSS(*PublicKey, crypto.Hash, []uint8, []uint8, *PSSOptions) error
 pkg crypto/rsa, type PSSOptions struct
 pkg crypto/rsa, type PSSOptions struct, SaltLength int
+pkg crypto/sha1, func Sum([]uint8) [Size]uint8
+pkg crypto/sha256, func Sum224([]uint8) [Size224]uint8
+pkg crypto/sha256, func Sum256([]uint8) [Size]uint8
+pkg crypto/sha512, func Sum384([]uint8) [Size384]uint8
+pkg crypto/sha512, func Sum512([]uint8) [Size]uint8
 pkg crypto/subtle, func ConstantTimeLessOrEq(int, int) int
+pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16
+pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16
+pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16
 pkg crypto/tls, const VersionSSL30 ideal-int
 pkg crypto/tls, const VersionTLS10 ideal-int
 pkg crypto/tls, const VersionTLS11 ideal-int
+pkg crypto/tls, const VersionTLS12 ideal-int
 pkg crypto/tls, type Config struct, MaxVersion uint16
 pkg crypto/tls, type Config struct, MinVersion uint16
+pkg crypto/x509, func MarshalECPrivateKey(*ecdsa.PrivateKey) ([]uint8, error)
+pkg crypto/x509, type Certificate struct, CRLDistributionPoints []string
+pkg crypto/x509, type Certificate struct, IssuingCertificateURL []string
+pkg crypto/x509, type Certificate struct, OCSPServer []string
+pkg flag, type Getter interface { Get, Set, String }
+pkg flag, type Getter interface, Get() interface{}
+pkg flag, type Getter interface, Set(string) error
+pkg flag, type Getter interface, String() string
+pkg go/ast, type SliceExpr struct, Max Expr
 pkg go/ast, type TypeAssertExpr struct, Lparen token.Pos
 pkg go/ast, type TypeAssertExpr struct, Rparen token.Pos
 pkg go/build, type Package struct, CXXFiles []string
 pkg go/build, type Package struct, CgoCPPFLAGS []string
 pkg go/build, type Package struct, CgoCXXFLAGS []string
+pkg image/color, var Plan9Palette []Color
+pkg image/color, var WebSafePalette []Color
+pkg image/draw, method (Op) Draw(Image, image.Rectangle, image.Image, image.Point)
+pkg image/draw, type Drawer interface { Draw }
+pkg image/draw, type Drawer interface, Draw(Image, image.Rectangle, image.Image, image.Point)
+pkg image/draw, type Quantizer interface { Quantize }
+pkg image/draw, type Quantizer interface, Quantize(color.Palette, image.Image) color.Palette
+pkg image/draw, var FloydSteinberg Drawer
+pkg image/gif, func Encode(io.Writer, image.Image, *Options) error
+pkg image/gif, func EncodeAll(io.Writer, *GIF) error
+pkg image/gif, type Options struct
+pkg image/gif, type Options struct, Drawer draw.Drawer
+pkg image/gif, type Options struct, NumColors int
+pkg image/gif, type Options struct, Quantizer draw.Quantizer
 pkg log/syslog (freebsd-386-cgo), const LOG_ALERT Priority
 pkg log/syslog (freebsd-386-cgo), const LOG_AUTH Priority
 pkg log/syslog (freebsd-386-cgo), const LOG_AUTHPRIV Priority
@@ -660,6 +696,12 @@ pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Warning(string) error
 pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Write([]uint8) (int, error)
 pkg log/syslog (openbsd-amd64-cgo), type Priority int
 pkg log/syslog (openbsd-amd64-cgo), type Writer struct
+pkg net, method (*TCPConn) SetKeepAlivePeriod(time.Duration) error
+pkg net/smtp, method (*Client) Close() error
+pkg reflect, method (Value) SetCap(int)
+pkg reflect, method (Value) Slice3(int, int, int) Value
+pkg sort, func Stable(Interface)
+pkg strings, func IndexByte(string, uint8) int
 pkg syscall (darwin-386), const ICMP6_FILTER ideal-int
 pkg syscall (darwin-386), const PRIO_PGRP ideal-int
 pkg syscall (darwin-386), const PRIO_PROCESS ideal-int
@@ -697,6 +739,7 @@ pkg syscall (darwin-amd64), const SizeofIPv6MTUInfo ideal-int
 pkg syscall (darwin-amd64), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error)
 pkg syscall (darwin-amd64), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error)
 pkg syscall (darwin-amd64), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
+pkg syscall (darwin-amd64), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
 pkg syscall (darwin-amd64), type ICMPv6Filter struct
 pkg syscall (darwin-amd64), type ICMPv6Filter struct, Filt [8]uint32
 pkg syscall (darwin-amd64), type IPv6MTUInfo struct
@@ -711,6 +754,7 @@ pkg syscall (darwin-amd64-cgo), const SizeofIPv6MTUInfo ideal-int
 pkg syscall (darwin-amd64-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error)
 pkg syscall (darwin-amd64-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error)
 pkg syscall (darwin-amd64-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
+pkg syscall (darwin-amd64-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
 pkg syscall (darwin-amd64-cgo), type ICMPv6Filter struct
 pkg syscall (darwin-amd64-cgo), type ICMPv6Filter struct, Filt [8]uint32
 pkg syscall (darwin-amd64-cgo), type IPv6MTUInfo struct
@@ -9557,10 +9601,12 @@ pkg syscall (linux-386), const PRIO_PROCESS ideal-int
 pkg syscall (linux-386), const PRIO_USER ideal-int
 pkg syscall (linux-386), const SizeofICMPv6Filter ideal-int
 pkg syscall (linux-386), const SizeofIPv6MTUInfo ideal-int
+pkg syscall (linux-386), func Dup3(int, int, int) error
 pkg syscall (linux-386), func Getpriority(int, int) (int, error)
 pkg syscall (linux-386), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error)
 pkg syscall (linux-386), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error)
 pkg syscall (linux-386), func Setpriority(int, int, int) error
+pkg syscall (linux-386), func SetsockoptByte(int, int, int, uint8) error
 pkg syscall (linux-386), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
 pkg syscall (linux-386), type ICMPv6Filter struct
 pkg syscall (linux-386), type ICMPv6Filter struct, Data [8]uint32
@@ -9573,10 +9619,12 @@ pkg syscall (linux-386-cgo), const PRIO_PROCESS ideal-int
 pkg syscall (linux-386-cgo), const PRIO_USER ideal-int
 pkg syscall (linux-386-cgo), const SizeofICMPv6Filter ideal-int
 pkg syscall (linux-386-cgo), const SizeofIPv6MTUInfo ideal-int
+pkg syscall (linux-386-cgo), func Dup3(int, int, int) error
 pkg syscall (linux-386-cgo), func Getpriority(int, int) (int, error)
 pkg syscall (linux-386-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error)
 pkg syscall (linux-386-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error)
 pkg syscall (linux-386-cgo), func Setpriority(int, int, int) error
+pkg syscall (linux-386-cgo), func SetsockoptByte(int, int, int, uint8) error
 pkg syscall (linux-386-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
 pkg syscall (linux-386-cgo), type ICMPv6Filter struct
 pkg syscall (linux-386-cgo), type ICMPv6Filter struct, Data [8]uint32
@@ -9589,10 +9637,12 @@ pkg syscall (linux-amd64), const PRIO_PROCESS ideal-int
 pkg syscall (linux-amd64), const PRIO_USER ideal-int
 pkg syscall (linux-amd64), const SizeofICMPv6Filter ideal-int
 pkg syscall (linux-amd64), const SizeofIPv6MTUInfo ideal-int
+pkg syscall (linux-amd64), func Dup3(int, int, int) error
 pkg syscall (linux-amd64), func Getpriority(int, int) (int, error)
 pkg syscall (linux-amd64), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error)
 pkg syscall (linux-amd64), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error)
 pkg syscall (linux-amd64), func Setpriority(int, int, int) error
+pkg syscall (linux-amd64), func SetsockoptByte(int, int, int, uint8) error
 pkg syscall (linux-amd64), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
 pkg syscall (linux-amd64), type ICMPv6Filter struct
 pkg syscall (linux-amd64), type ICMPv6Filter struct, Data [8]uint32
@@ -9605,10 +9655,12 @@ pkg syscall (linux-amd64-cgo), const PRIO_PROCESS ideal-int
 pkg syscall (linux-amd64-cgo), const PRIO_USER ideal-int
 pkg syscall (linux-amd64-cgo), const SizeofICMPv6Filter ideal-int
 pkg syscall (linux-amd64-cgo), const SizeofIPv6MTUInfo ideal-int
+pkg syscall (linux-amd64-cgo), func Dup3(int, int, int) error
 pkg syscall (linux-amd64-cgo), func Getpriority(int, int) (int, error)
 pkg syscall (linux-amd64-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error)
 pkg syscall (linux-amd64-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error)
 pkg syscall (linux-amd64-cgo), func Setpriority(int, int, int) error
+pkg syscall (linux-amd64-cgo), func SetsockoptByte(int, int, int, uint8) error
 pkg syscall (linux-amd64-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
 pkg syscall (linux-amd64-cgo), type ICMPv6Filter struct
 pkg syscall (linux-amd64-cgo), type ICMPv6Filter struct, Data [8]uint32
@@ -9621,10 +9673,12 @@ pkg syscall (linux-arm), const PRIO_PROCESS ideal-int
 pkg syscall (linux-arm), const PRIO_USER ideal-int
 pkg syscall (linux-arm), const SizeofICMPv6Filter ideal-int
 pkg syscall (linux-arm), const SizeofIPv6MTUInfo ideal-int
+pkg syscall (linux-arm), func Dup3(int, int, int) error
 pkg syscall (linux-arm), func Getpriority(int, int) (int, error)
 pkg syscall (linux-arm), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error)
 pkg syscall (linux-arm), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error)
 pkg syscall (linux-arm), func Setpriority(int, int, int) error
+pkg syscall (linux-arm), func SetsockoptByte(int, int, int, uint8) error
 pkg syscall (linux-arm), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
 pkg syscall (linux-arm), type ICMPv6Filter struct
 pkg syscall (linux-arm), type ICMPv6Filter struct, Data [8]uint32
@@ -11392,6 +11446,7 @@ pkg syscall (linux-arm-cgo), func Creat(string, uint32) (int, error)
 pkg syscall (linux-arm-cgo), func DetachLsf(int) error
 pkg syscall (linux-arm-cgo), func Dup(int) (int, error)
 pkg syscall (linux-arm-cgo), func Dup2(int, int) error
+pkg syscall (linux-arm-cgo), func Dup3(int, int, int) error
 pkg syscall (linux-arm-cgo), func EpollCreate(int) (int, error)
 pkg syscall (linux-arm-cgo), func EpollCreate1(int) (int, error)
 pkg syscall (linux-arm-cgo), func EpollCtl(int, int, int, *EpollEvent) error
@@ -11515,6 +11570,7 @@ pkg syscall (linux-arm-cgo), func Setresuid(int, int, int) error
 pkg syscall (linux-arm-cgo), func Setreuid(int, int) error
 pkg syscall (linux-arm-cgo), func Setrlimit(int, *Rlimit) error
 pkg syscall (linux-arm-cgo), func Setsid() (int, error)
+pkg syscall (linux-arm-cgo), func SetsockoptByte(int, int, int, uint8) error
 pkg syscall (linux-arm-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error
 pkg syscall (linux-arm-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error
 pkg syscall (linux-arm-cgo), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error
@@ -31644,3 +31700,16 @@ pkg syscall (windows-amd64), const NetSetupUnknownStatus ideal-int
 pkg syscall (windows-amd64), const NetSetupWorkgroupName ideal-int
 pkg syscall (windows-amd64), const PROCESS_TERMINATE ideal-int
 pkg syscall (windows-amd64), func NetGetJoinInformation(*uint16, **uint16, *uint32) error
+pkg testing, func RegisterCover(Cover)
+pkg testing, type Cover struct
+pkg testing, type Cover struct, Blocks map[string][]CoverBlock
+pkg testing, type Cover struct, Counters map[string][]uint32
+pkg testing, type Cover struct, CoveredPackages string
+pkg testing, type Cover struct, Mode string
+pkg testing, type CoverBlock struct
+pkg testing, type CoverBlock struct, Col0 uint16
+pkg testing, type CoverBlock struct, Col1 uint16
+pkg testing, type CoverBlock struct, Line0 uint32
+pkg testing, type CoverBlock struct, Line1 uint32
+pkg testing, type CoverBlock struct, Stmts uint16
+pkg unicode, func In(int32, ...*RangeTable) bool

コアとなるコードの解説

api/next.txtは、GoのAPIチェッカーが使用するAPIの「ホワイトリスト」のようなものです。このファイルに記載されていない公開APIがコードベースに存在する場合、ビルド時にエラーまたは警告が発生し、Goの互換性ポリシー違反が検出されます。

このコミットでは、以下の形式で新しいAPIエントリが追加されています。

pkg <パッケージパス>, <APIの種類> <APIシグネチャ>

例:

  • pkg container/list, method (*List) MoveAfter(*Element, *Element): container/listパッケージのList型にMoveAfterメソッドが追加されたことを示します。
  • pkg crypto, type PublicKey interface {}: cryptoパッケージにPublicKeyという新しいインターフェース型が追加されたことを示します。
  • pkg crypto/md5, func Sum([]uint8) [Size]uint8: crypto/md5パッケージにSumという新しい関数が追加されたことを示します。
  • pkg testing, type Cover struct, Blocks map[string][]CoverBlock: testingパッケージのCover構造体にBlocksというフィールドが追加されたことを示します。

これらのエントリは、Goの標準ライブラリが継続的に進化し、新しい機能が追加されていることを明確に示しています。特に、暗号化、画像処理、リフレクション、システムコールといった分野での拡張は、Goがより多様なアプリケーション開発に対応できるようになっていることを示唆しています。

関連リンク

  • Go 1 Compatibility Guarantee: https://go.dev/doc/go1compat
  • GoのAPIチェッカーに関する情報 (Goのソースコード内のドキュメントや関連するGo Change Proposalなどを参照):

参考にした情報源リンク