[インデックス 15476] ファイルの概要
このコミットは、Go言語の次期リリースで導入されるAPIの変更点を記録するapi/next.txt
ファイルを更新するものです。具体的には、bufio
、encoding/xml
、go/types
、net
、net/http
、syscall
、testing
といった複数の標準パッケージにわたる新しい関数、型、定数、メソッドの追加が反映されています。これは、Go言語の進化に伴うAPIの拡張と改善を示す重要なスナップショットとなります。
コミット
commit e97aa82c2f05dcce6a875d69ea2d88dff04f000a
Author: Brad Fitzpatrick <bradfitz@golang.org>
Date: Wed Feb 27 15:19:59 2013 -0800
api: update next.txt
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7420043
GitHub上でのコミットページへのリンク
https://github.com/golang/go/commit/e97aa82c2f05dcce6a875d69ea2d88dff04f000a
元コミット内容
api: update next.txt
変更の背景
このコミットは、Go言語の将来のバージョン(当時)で導入される予定の新しいAPI要素をapi/next.txt
ファイルに記録するために行われました。api/next.txt
は、GoのAPI互換性ポリシーを維持するために非常に重要なファイルです。Go言語では、既存の公開APIを変更しないという強力な互換性保証があります。新しいAPIが追加される際、それらはまずこのnext.txt
ファイルにリストアップされ、レビュープロセスを経て正式なAPIとして承認されます。これにより、開発者は将来の変更を事前に把握し、互換性の問題を回避することができます。
この特定のコミットは、Go 1.1のリリースに向けた開発サイクルの一部として行われたと考えられます。Go 1.1では、Go 1.0の安定性を基盤としつつ、パフォーマンスの向上、ツールの改善、そしていくつかの重要なAPIの追加が行われました。このnext.txt
の更新は、そのAPI追加の進捗を反映したものです。
前提知識の解説
Go言語のAPI互換性ポリシー
Go言語は、バージョン1以降、厳格なAPI互換性ポリシーを維持しています。これは、Go 1でリリースされた公開APIは、将来のGoのバージョンでも変更されないことを意味します。このポリシーにより、Goプログラムは新しいGoバージョンにアップグレードしても、既存のコードが壊れることなく動作し続けることが保証されます。
api/next.txt
ファイルは、この互換性ポリシーを管理するための一環として使用されます。新しいAPIがGoの標準ライブラリに追加される前に、そのAPIのシグネチャがこのファイルに記録されます。これにより、APIの設計がコミュニティによってレビューされ、将来の互換性を損なわないことが確認されます。
Goの標準パッケージ
このコミットで変更が加えられている主なパッケージは以下の通りです。
bufio
: バッファリングされたI/Oを提供するパッケージです。効率的な読み書き操作を可能にします。encoding/xml
: XMLエンコーディングとデコーディングをサポートするパッケージです。go/types
: Goの型システムに関する情報を提供するパッケージです。主にGoのツール(コンパイラ、リンタ、IDEなど)がGoのソースコードを解析し、型情報を取得するために使用します。net
: ネットワークI/Oを提供するパッケージです。TCP/IP、UDP、Unixドメインソケットなどのネットワークプロトコルをサポートします。net/http
: HTTPクライアントとサーバーの実装を提供するパッケージです。Webアプリケーション開発の基盤となります。syscall
: オペレーティングシステムが提供する低レベルのプリミティブ(システムコール)へのアクセスを提供するパッケージです。OS固有の機能にアクセスするために使用されます。testing
: Goのテストフレームワークを提供するパッケージです。ユニットテスト、ベンチマークテスト、例のテストなどを記述するために使用されます。
これらのパッケージはGoの標準ライブラリの重要な部分であり、Goアプリケーションの様々な側面を支えています。
技術的詳細
このコミットは、Goの標準ライブラリに複数の新しいAPI要素を追加しています。それぞれのパッケージにおける追加の技術的詳細を以下に示します。
bufio
パッケージの変更点
bufio
パッケージには、新しいScanner
型とその関連関数、メソッドが追加されています。
MaxScanTokenSize
定数: スキャンされるトークンの最大サイズを定義します。NewScanner(io.Reader) *Scanner
:io.Reader
から新しいScanner
を作成するコンストラクタです。ScanBytes([]uint8, bool) (int, []uint8, error)
: バイト単位でスキャンするための分割関数です。ScanLines([]uint8, bool) (int, []8, error)
: 行単位でスキャンするための分割関数です。ScanRunes([]uint8, bool) (int, []uint8, error)
: Unicodeルーン単位でスキャンするための分割関数です。ScanWords([]uint8, bool) (int, []uint8, error)
: 単語単位でスキャンするための分割関数です。(*Scanner) Bytes() []uint8
: 現在のスキャンされたトークンをバイトスライスとして返します。(*Scanner) Err() error
: スキャン中に発生したエラーを返します。(*Scanner) Scan() bool
: 次のトークンを読み込みます。(*Scanner) Split(SplitFunc)
: スキャン方法をカスタマイズするための分割関数を設定します。(*Scanner) Text() string
: 現在のスキャンされたトークンを文字列として返します。Scanner
型: 入力ストリームをトークン(行、単語など)に分割するための便利なインターフェースを提供します。SplitFunc
型:Scanner
の分割ロジックを定義するための関数型です。ErrAdvanceTooFar
,ErrNegativeAdvance
,ErrTooLong
変数:Scanner
操作中に発生しうる特定のエラーを表します。
これらの追加により、bufio
パッケージは、テキストやバイナリデータを効率的に解析するための、より強力で柔軟なツールを提供します。特に、行や単語、カスタムデリミタによるストリームの読み込みが容易になります。
encoding/xml
パッケージの変更点
EscapeText(io.Writer, []uint8) error
: XMLテキストをエスケープし、指定されたio.Writer
に書き込む関数が追加されています。これにより、XMLドキュメント内に特殊文字を安全に含めることができるようになります。
go/types
パッケージの変更点
go/types
パッケージは、Goの型システムをプログラム的に扱うための重要なツールです。このコミットでは、型情報の取得と操作に関する多くの改善が加えられています。
DefaultMaxAlign
,DefaultPtrSize
定数: デフォルトの最大アラインメントとポインタサイズを定義します。DefaultAlignof(Type) int64
: 型のアラインメントを計算するデフォルト関数です。DefaultOffsetsof([]*Field) []int64
: 構造体フィールドのオフセットを計算するデフォルト関数です。DefaultSizeof(Type) int64
: 型のサイズを計算するデフォルト関数です。(*Const) GetPkg() *Package
,(*Func) GetPkg() *Package
,(*Package) GetPkg() *Package
,(*TypeName) GetPkg() *Package
,(*Var) GetPkg() *Package
:Object
インターフェースを実装する様々な型に対して、それが属するパッケージを取得するGetPkg
メソッドが追加されています。これにより、型情報からその定義元のパッケージを簡単に辿れるようになります。Context
構造体へのフィールド追加:Alignof
,Offsetsof
,Sizeof
といった関数ポインタが追加され、型情報の計算ロジックをカスタマイズできるようになっています。
これらの変更は、Goのツールチェイン(コンパイラ、リンタ、静的解析ツールなど)がGoのコードベースをより深く理解し、分析するための基盤を強化します。
net
パッケージの変更点
net
パッケージには、ネットワーク接続の確立に関する柔軟性を高めるための新しいDialOption
関連のAPIが追加されています。
Deadline(time.Time) DialOption
: 接続のデッドラインを設定するDialOption
です。DialOpt(string, ...DialOption) (Conn, error)
:DialOption
を使用してネットワーク接続を確立する新しい関数です。LocalAddress(Addr) DialOption
: ローカルアドレスを設定するDialOption
です。Network(string) DialOption
: ネットワークタイプ(例: "tcp", "udp")を設定するDialOption
です。Timeout(time.Duration) DialOption
: 接続タイムアウトを設定するDialOption
です。DialOption
インターフェース:DialOpt
関数で使用されるオプションのインターフェースです。TCP
,UDP
変数: TCPおよびUDPネットワークタイプに対応するDialOption
の定数です。
これらの追加により、ネットワーク接続の確立時に、より細かな制御(タイムアウト、ローカルアドレスの指定など)が可能になり、より堅牢なネットワークアプリケーションを構築できるようになります。
net/http
パッケージの変更点
Transport
構造体へのResponseHeaderTimeout
フィールド追加: HTTPレスポンスヘッダーの読み込みタイムアウトを設定できるようになります。これにより、遅いサーバーからのレスポンスヘッダーの読み込みによるハングアップを防ぐことができます。
syscall
パッケージの変更点
syscall
パッケージには、FreeBSDおよびLinuxの特定のアーキテクチャ(386, amd64, arm)向けのシステムコール関連の定数や構造体が多数追加されています。これらは主にネットワークインターフェースの通知(FreeBSDのIFAN_ARRIVAL
, IFAN_DEPARTURE
など)や、LinuxのNetlinkソケットに関連するグループ定数(RTNLGRP_IPV4_IFADDR
など)です。また、Windows向けのReadConsole
関数も追加されています。これらの変更は、Goがより多くのプラットフォームで低レベルのシステム機能にアクセスできるようにするためのものです。
testing
パッケージの変更点
testing
パッケージには、ベンチマークテスト(*B
)と通常のテスト(*T
)の両方で、テストのスキップに関する機能が追加されています。
(*B) Skip(...interface{})
,(*B) SkipNow()
,(*B) Skipf(string, ...interface{})
,(*B) Skipped() bool
: ベンチマークテストをスキップしたり、スキップされたかどうかを確認したりするためのメソッドです。(*T) Skip(...interface{})
,(*T) SkipNow()
,(*T) Skipf(string, ...interface{})
,(*T) Skipped() bool
: 通常のテストをスキップしたり、スキップされたかどうかを確認したりするためのメソッドです。
これらの機能により、特定の条件(例: 特定のOS、外部リソースの有無など)に基づいてテストを条件付きで実行したり、テストの実行を途中で中断したりすることが容易になります。これは、テストの柔軟性と効率性を向上させます。
コアとなるコードの変更箇所
このコミットのコアとなる変更は、api/next.txt
ファイルへの追加です。このファイルは、Goの次期リリースで公開されるAPIのリストを定義しています。
--- a/api/next.txt
+++ b/api/next.txt
@@ -4,10 +4,26 @@ pkg archive/tar, func FileInfoHeader(os.FileInfo, string) (*Header, error)
pkg archive/tar, method (*Header) FileInfo() os.FileInfo
pkg archive/zip, type FileHeader struct, CompressedSize64 uint64
pkg archive/zip, type FileHeader struct, UncompressedSize64 uint64
+pkg bufio, const MaxScanTokenSize ideal-int
+pkg bufio, func NewScanner(io.Reader) *Scanner
+pkg bufio, func ScanBytes([]uint8, bool) (int, []uint8, error)
+pkg bufio, func ScanLines([]uint8, bool) (int, []uint8, error)
+pkg bufio, func ScanRunes([]uint8, bool) (int, []uint8, error)
+pkg bufio, func ScanWords([]uint8, bool) (int, []uint8, error)
pkg bufio, method (*Reader) WriteTo(io.Writer) (int64, error)
+pkg bufio, method (*Scanner) Bytes() []uint8
+pkg bufio, method (*Scanner) Err() error
+pkg bufio, method (*Scanner) Scan() bool
+pkg bufio, method (*Scanner) Split(SplitFunc)
+pkg bufio, method (*Scanner) Text() string
pkg bufio, method (*Writer) ReadFrom(io.Reader) (int64, error)
pkg bufio, method (ReadWriter) ReadFrom(io.Reader) (int64, error)
pkg bufio, method (ReadWriter) WriteTo(io.Writer) (int64, error)
+pkg bufio, type Scanner struct
+pkg bufio, type SplitFunc func([]uint8, bool) (int, []uint8, error)
+pkg bufio, var ErrAdvanceTooFar error
+pkg bufio, var ErrNegativeAdvance error
+pkg bufio, var ErrTooLong error
pkg bytes, func TrimPrefix([]uint8, []uint8) []uint8
pkg bytes, func TrimSuffix([]uint8, []uint8) []uint8
pkg bytes, method (*Buffer) Grow(int)
@@ -71,6 +87,7 @@ pkg encoding/json, method (Number) Float64() (float64, error)
pkg encoding/json, method (Number) Int64() (int64, error)
pkg encoding/json, method (Number) String() string
pkg encoding/json, type Number string
+pkg encoding/xml, func EscapeText(io.Writer, []uint8) error
pkg encoding/xml, method (*Encoder) Indent(string, string)
pkg go/ast, func NewCommentMap(*token.FileSet, Node, []*CommentGroup) CommentMap
pkg go/ast, method (CommentMap) Comments() []*CommentGroup
@@ -96,6 +113,8 @@ pkg go/types, const Bool BasicKind
pkg go/types, const Byte BasicKind
pkg go/types, const Complex128 BasicKind
pkg go/types, const Complex64 BasicKind
+pkg go/types, const DefaultMaxAlign ideal-int
+pkg go/types, const DefaultPtrSize ideal-int
pkg go/types, const Float32 BasicKind
pkg go/types, const Float64 BasicKind
pkg go/types, const Int BasicKind
@@ -131,6 +150,9 @@ pkg go/types, const UntypedNil BasicKind
pkg go/types, const UntypedRune BasicKind
pkg go/types, const UntypedString BasicKind
pkg go/types, func Check(*token.FileSet, []*ast.File) (*Package, error)
+pkg go/types, func DefaultAlignof(Type) int64
+pkg go/types, func DefaultOffsetsof([]*Field) []int64
+pkg go/types, func DefaultSizeof(Type) int64
pkg go/types, func FindGcExportData(*bufio.Reader) error
pkg go/types, func FindPkg(string, string) (string, string)
pkg go/types, func GcImport(map[string]*Package, string) (*Package, error)
@@ -140,16 +162,19 @@ pkg go/types, method (*Array) String() string
pkg go/types, method (*Basic) String() string
pkg go/types, method (*Chan) String() string
pkg go/types, method (*Const) GetName() string
+pkg go/types, method (*Const) GetPkg() *Package
pkg go/types, method (*Const) GetPos() token.Pos
pkg go/types, method (*Const) GetType() Type
pkg go/types, method (*Context) Check(*token.FileSet, []*ast.File) (*Package, error)
pkg go/types, method (*Func) GetName() string
+pkg go/types, method (*Func) GetPkg() *Package
pkg go/types, method (*Func) GetPos() token.Pos
pkg go/types, method (*Func) GetType() Type
pkg go/types, method (*Interface) String() string
pkg go/types, method (*Map) String() string
pkg go/types, method (*NamedType) String() string
pkg go/types, method (*Package) GetName() string
+pkg go/types, method (*Package) GetPkg() *Package
pkg go/types, method (*Package) GetPos() token.Pos
pkg go/types, method (*Package) GetType() Type
pkg go/types, method (*Pointer) String() string
@@ -161,9 +186,11 @@ pkg go/types, method (*Signature) String() string
pkg go/types, method (*Slice) String() string
pkg go/types, method (*Struct) String() string
pkg go/types, method (*TypeName) GetName() string
+pkg go/types, method (*TypeName) GetPkg() *Package
pkg go/types, method (*TypeName) GetPos() token.Pos
pkg go/types, method (*TypeName) GetType() Type
pkg go/types, method (*Var) GetName() string
+pkg go/types, method (*Var) GetPkg() *Package
pkg go/types, method (*Var) GetPos() token.Pos
pkg go/types, method (*Var) GetType() Type
pkg go/types, method (Complex) String() string
@@ -189,15 +216,19 @@ pkg go/types, type Complex struct, Im *big.Rat
pkg go/types, type Complex struct, Re *big.Rat
pkg go/types, type Const struct
pkg go/types, type Const struct, Name string
+pkg go/types, type Const struct, Pkg *Package
pkg go/types, type Const struct, Type Type
pkg go/types, type Const struct, Val interface{}
pkg go/types, type Context struct
+pkg go/types, type Context struct, Alignof func(Type) int64
pkg go/types, type Context struct, Error func(error)
pkg go/types, type Context struct, Expr func(ast.Expr, Type, interface{})
pkg go/types, type Context struct, Ident func(*ast.Ident, Object)
pkg go/types, type Context struct, Import Importer
pkg go/types, type Context struct, IntSize int64
+pkg go/types, type Context struct, Offsetsof func([]*Field) []int64
pkg go/types, type Context struct, PtrSize int64
+pkg go/types, type Context struct, Sizeof func(Type) int64
pkg go/types, type Field struct
pkg go/types, type Field struct, IsAnonymous bool
pkg go/types, type Field struct, Tag string
@@ -205,6 +236,7 @@ pkg go/types, type Field struct, Type Type
pkg go/types, type Field struct, embedded QualifiedName
pkg go/types, type Func struct
pkg go/types, type Func struct, Name string
+pkg go/types, type Func struct, Pkg *Package
pkg go/types, type Func struct, Type Type
pkg go/types, type Importer func(imports map[string]*Package, path string) (pkg *Package, err error)
pkg go/types, type Importer func(map[string]*Package, string) (*Package, error)
@@ -222,6 +254,7 @@ pkg go/types, type NamedType struct, Obj *TypeName
pkg go/types, type NamedType struct, Underlying Type
pkg go/types, type NilType struct
pkg go/types, type Object interface, GetName() string
+pkg go/types, type Object interface, GetPkg() *Package
pkg go/types, type Object interface, GetPos() token.Pos
pkg go/types, type Object interface, GetType() Type
pkg go/types, type Object interface, unexported methods
@@ -254,9 +287,11 @@ pkg go/types, type Type interface, String() string
pkg go/types, type Type interface, unexported methods
pkg go/types, type TypeName struct
pkg go/types, type TypeName struct, Name string
+pkg go/types, type TypeName struct, Pkg *Package
pkg go/types, type TypeName struct, Type Type
pkg go/types, type Var struct
pkg go/types, type Var struct, Name string
+pkg go/types, type Var struct, Pkg *Package
pkg go/types, type Var struct, Type Type
pkg go/types, var Default Context
pkg go/types, var Typ [...]*Basic
@@ -492,20 +527,28 @@ pkg math/big, method (*Int) UnmarshalJSON([]uint8) error
pkg math/big, method (*Rat) Float64() (float64, bool)
pkg math/big, method (*Rat) SetFloat64(float64) *Rat
pkg mime/multipart, method (*Writer) SetBoundary(string) error
+pkg net, func Deadline(time.Time) DialOption
+pkg net, func DialOpt(string, ...DialOption) (Conn, error)
pkg net, func ListenUnixgram(string, *UnixAddr) (*UnixConn, error)
+pkg net, func LocalAddress(Addr) DialOption
pkg net, func LookupNS(string) ([]*NS, error)
+pkg net, func Network(string) DialOption
+pkg net, func Timeout(time.Duration) DialOption
pkg net, method (*IPConn) ReadMsgIP([]uint8, []uint8) (int, int, int, *IPAddr, error)
pkg net, method (*IPConn) WriteMsgIP([]uint8, []uint8, *IPAddr) (int, int, error)
pkg net, method (*UDPConn) ReadMsgUDP([]uint8, []uint8) (int, int, int, *UDPAddr, error)
pkg net, method (*UDPConn) WriteMsgUDP([]uint8, []uint8, *UDPAddr) (int, int, error)
pkg net, method (*UnixConn) CloseRead() error
pkg net, method (*UnixConn) CloseWrite() error
+pkg net, type DialOption interface, unexported methods
pkg net, type IPAddr struct, Zone string
pkg net, type IPNet struct, Zone string
pkg net, type NS struct
pkg net, type NS struct, Host string
pkg net, type TCPAddr struct, Zone string
pkg net, type UDPAddr struct, Zone string
+pkg net, var TCP DialOption
+pkg net, var UDP DialOption
pkg net/http, func ParseTime(string) (time.Time, error)
pkg net/http, method (*Request) PostFormValue(string) string
pkg net/http, method (*ServeMux) Handler(*Request) (Handler, string)
@@ -513,6 +556,7 @@ pkg net/http, type CloseNotifier interface { CloseNotify }
pkg net/http, type CloseNotifier interface, CloseNotify() <-chan bool
pkg net/http, type Request struct, PostForm url.Values
pkg net/http, type Server struct, TLSNextProto map[string]func(*Server, *tls.Conn, Handler)
+pkg net/http, type Transport struct, ResponseHeaderTimeout time.Duration
pkg net/mail, func ParseAddress(string) (*Address, error)
pkg net/mail, func ParseAddressList(string) ([]*Address, error)
pkg net/smtp, method (*Client) Hello(string) error
@@ -987,9 +1031,49 @@ pkg syscall (darwin-amd64-cgo), type Termios struct, Lflag uint64
pkg syscall (darwin-amd64-cgo), type Termios struct, Oflag uint64
pkg syscall (darwin-amd64-cgo), type Termios struct, Ospeed uint64
pkg syscall (darwin-amd64-cgo), type Termios struct, Pad_cgo_0 [4]uint8
+pkg syscall (freebsd-386), const IFAN_ARRIVAL ideal-int
+pkg syscall (freebsd-386), const IFAN_DEPARTURE ideal-int
+pkg syscall (freebsd-386), const SizeofIfAnnounceMsghdr ideal-int
pkg syscall (freebsd-386), func SlicePtrFromStrings([]string) ([]*uint8, error)
+pkg syscall (freebsd-386), type IfAnnounceMsghdr struct
+pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Index uint16
+pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Msglen uint16
+pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Name [16]int8
+pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Type uint8
+pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Version uint8
+pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, What uint16
+pkg syscall (freebsd-386), type InterfaceAnnounceMessage struct
+pkg syscall (freebsd-386), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr
+pkg syscall (freebsd-amd64), const IFAN_ARRIVAL ideal-int
+pkg syscall (freebsd-amd64), const IFAN_DEPARTURE ideal-int
+pkg syscall (freebsd-amd64), const SizeofIfAnnounceMsghdr ideal-int
pkg syscall (freebsd-amd64), func SlicePtrFromStrings([]string) ([]*uint8, error)
pkg syscall (freebsd-amd64), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
+pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct
+pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Index uint16
+pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Msglen uint16
+pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Name [16]int8
+pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Type uint8
+pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Version uint8
+pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, What uint16
+pkg syscall (freebsd-amd64), type InterfaceAnnounceMessage struct
+pkg syscall (freebsd-amd64), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr
+pkg syscall (linux-386), const RTNLGRP_IPV4_IFADDR ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV4_MROUTE ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV4_ROUTE ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV4_RULE ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV6_IFADDR ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV6_IFINFO ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV6_MROUTE ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV6_PREFIX ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV6_ROUTE ideal-int
+pkg syscall (linux-386), const RTNLGRP_IPV6_RULE ideal-int
+pkg syscall (linux-386), const RTNLGRP_LINK ideal-int
+pkg syscall (linux-386), const RTNLGRP_ND_USEROPT ideal-int
+pkg syscall (linux-386), const RTNLGRP_NEIGH ideal-int
+pkg syscall (linux-386), const RTNLGRP_NONE ideal-int
+pkg syscall (linux-386), const RTNLGRP_NOTIFY ideal-int
+pkg syscall (linux-386), const RTNLGRP_TC ideal-int
pkg syscall (linux-386), const SizeofTCPInfo ideal-int
pkg syscall (linux-386), func Accept4(int, int) (int, Sockaddr, error)
pkg syscall (linux-386), func GetsockoptUcred(int, int, int) (*Ucred, error)
@@ -1033,6 +1117,22 @@ pkg syscall (linux-386), type TCPInfo struct, Snd_ssthresh uint32
pkg syscall (linux-386), type TCPInfo struct, State uint8
pkg syscall (linux-386), type TCPInfo struct, Total_retrans uint32
pkg syscall (linux-386), type TCPInfo struct, Unacked uint32
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_IFADDR ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_MROUTE ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_ROUTE ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_RULE ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_IFADDR ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_IFINFO ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_MROUTE ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_PREFIX ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_ROUTE ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_RULE ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_LINK ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_ND_USEROPT ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_NEIGH ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_NONE ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_NOTIFY ideal-int
+pkg syscall (linux-386-cgo), const RTNLGRP_TC ideal-int
pkg syscall (linux-386-cgo), const SizeofTCPInfo ideal-int
pkg syscall (linux-386-cgo), func Accept4(int, int) (int, Sockaddr, error)
pkg syscall (linux-386-cgo), func GetsockoptUcred(int, int, int) (*Ucred, error)
@@ -1076,6 +1176,22 @@ pkg syscall (linux-386-cgo), type TCPInfo struct, Snd_ssthresh uint32
pkg syscall (linux-386-cgo), type TCPInfo struct, State uint8
pkg syscall (linux-386-cgo), type TCPInfo struct, Total_retrans uint32
pkg syscall (linux-386-cgo), type TCPInfo struct, Unacked uint32
+pkg syscall (linux-amd64), const RTNLGRP_IPV4_IFADDR ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV4_MROUTE ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV4_ROUTE ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV4_RULE ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV6_IFADDR ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV6_IFINFO ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV6_MROUTE ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV6_PREFIX ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV6_ROUTE ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_IPV6_RULE ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_LINK ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_ND_USEROPT ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_NEIGH ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_NONE ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_NOTIFY ideal-int
+pkg syscall (linux-amd64), const RTNLGRP_TC ideal-int
pkg syscall (linux-amd64), const SizeofTCPInfo ideal-int
pkg syscall (linux-amd64), func Accept4(int, int) (int, Sockaddr, error)
pkg syscall (linux-amd64), func GetsockoptUcred(int, int, int) (*Ucred, error)
@@ -1119,6 +1235,22 @@ pkg syscall (linux-amd64), type TCPInfo struct, Snd_ssthresh uint32
pkg syscall (linux-amd64), type TCPInfo struct, State uint8
pkg syscall (linux-amd64), type TCPInfo struct, Total_retrans uint32
pkg syscall (linux-amd64), type TCPInfo struct, Unacked uint32
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_IFADDR ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_MROUTE ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_ROUTE ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_RULE ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_IFADDR ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_IFINFO ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_MROUTE ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_PREFIX ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_ROUTE ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_RULE ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_LINK ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_ND_USEROPT ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_NEIGH ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_NONE ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_NOTIFY ideal-int
+pkg syscall (linux-amd64-cgo), const RTNLGRP_TC ideal-int
pkg syscall (linux-amd64-cgo), const SizeofTCPInfo ideal-int
pkg syscall (linux-amd64-cgo), func Accept4(int, int) (int, Sockaddr, error)
pkg syscall (linux-amd64-cgo), func GetsockoptUcred(int, int, int) (*Ucred, error)
@@ -1162,6 +1294,22 @@ pkg syscall (linux-amd64-cgo), type TCPInfo struct, Snd_ssthresh uint32
pkg syscall (linux-amd64-cgo), type TCPInfo struct, State uint8
pkg syscall (linux-amd64-cgo), type TCPInfo struct, Total_retrans uint32
pkg syscall (linux-amd64-cgo), type TCPInfo struct, Unacked uint32
+pkg syscall (linux-arm), const RTNLGRP_IPV4_IFADDR ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV4_MROUTE ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV4_ROUTE ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV4_RULE ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV6_IFADDR ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV6_IFINFO ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV6_MROUTE ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV6_PREFIX ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV6_ROUTE ideal-int
+pkg syscall (linux-arm), const RTNLGRP_IPV6_RULE ideal-int
+pkg syscall (linux-arm), const RTNLGRP_LINK ideal-int
+pkg syscall (linux-arm), const RTNLGRP_ND_USEROPT ideal-int
+pkg syscall (linux-arm), const RTNLGRP_NEIGH ideal-int
+pkg syscall (linux-arm), const RTNLGRP_NONE ideal-int
+pkg syscall (linux-arm), const RTNLGRP_NOTIFY ideal-int
+pkg syscall (linux-arm), const RTNLGRP_TC ideal-int
pkg syscall (linux-arm), const SizeofTCPInfo ideal-int
pkg syscall (linux-arm), func Accept4(int, int) (int, Sockaddr, error)
pkg syscall (linux-arm), func GetsockoptUcred(int, int, int) (*Ucred, error)
@@ -1227,6 +1375,7 @@ pkg syscall (windows-386), func Getsockopt(Handle, int32, int32, *uint8, *int32)
pkg syscall (windows-386), func LoadCancelIoEx() error
pkg syscall (windows-386), func LoadConnectEx() error
pkg syscall (windows-386), func LoadGetAddrInfo() error
+pkg syscall (windows-386), func ReadConsole(Handle, *uint16, uint32, *uint32, *uint8) error
pkg syscall (windows-386), func UTF16FromString(string) ([]uint16, error)
pkg syscall (windows-386), func UTF16PtrFromString(string) (*uint16, error)
pkg syscall (windows-386), func WriteConsole(Handle, *uint16, uint32, *uint32, *uint8) error
@@ -1269,6 +1418,7 @@ pkg syscall (windows-amd64), func Getsockopt(Handle, int32, int32, *uint8, *int3
pkg syscall (windows-amd64), func LoadCancelIoEx() error
pkg syscall (windows-amd64), func LoadConnectEx() error
pkg syscall (windows-amd64), func LoadGetAddrInfo() error
+pkg syscall (windows-amd64), func ReadConsole(Handle, *uint16, uint32, *uint32, *uint8) error
pkg syscall (windows-amd64), func UTF16FromString(string) ([]uint16, error)
pkg syscall (windows-amd64), func UTF16PtrFromString(string) (*uint16, error)
pkg syscall (windows-amd64), func WriteConsole(Handle, *uint16, uint32, *uint32, *uint8) error
@@ -1302,6 +1452,10 @@ pkg syscall, type RawSockaddrInet6 struct, Scope_id uint32
pkg testing, func AllocsPerRun(int, func()) float64
pkg testing, func Verbose() bool
pkg testing, method (*B) ReportAllocs()
+pkg testing, method (*B) Skip(...interface{})
+pkg testing, method (*B) SkipNow()
+pkg testing, method (*B) Skipf(string, ...interface{})
+pkg testing, method (*B) Skipped() bool
pkg testing, method (*T) Skip(...interface{})
pkg testing, method (*T) SkipNow()
pkg testing, method (*T) Skipf(string, ...interface{})
コアとなるコードの解説
api/next.txt
ファイルは、GoのAPI互換性チェックツールによって使用される、Goの公開APIのリストです。このファイルに新しい行が追加されることは、Goの標準ライブラリに新しい関数、メソッド、型、定数などが追加されたことを意味します。
このコミットでは、主に以下のパッケージに新しいAPIが追加されています。
bufio
:Scanner
型とその関連機能が追加され、効率的なテキストスキャンが可能になりました。これは、ファイルやネットワークストリームから行、単語、またはカスタムデリミタで区切られたデータを読み取る際に非常に便利です。encoding/xml
:EscapeText
関数が追加され、XMLドキュメント内の特殊文字のエスケープ処理が容易になりました。go/types
: Goの型システムをプログラム的に扱うための機能が強化されました。特に、型のアラインメント、オフセット、サイズを計算するデフォルト関数や、オブジェクトが属するパッケージを取得するGetPkg
メソッドが追加され、Goの静的解析ツールやIDEの機能向上が期待されます。net
: ネットワーク接続の確立時に、より詳細な制御を可能にするDialOption
関連のAPIが追加されました。これにより、タイムアウトやローカルアドレスの指定など、より柔軟なネットワークプログラミングが可能になります。net/http
:Transport
構造体にResponseHeaderTimeout
フィールドが追加され、HTTPレスポンスヘッダーの読み込みタイムアウトを設定できるようになりました。これは、ネットワークの不安定性やサーバーの応答遅延に対する堅牢性を高めます。syscall
: 複数のOS(FreeBSD, Linux, Windows)およびアーキテクチャ(386, amd64, arm)向けのシステムコール関連の定数や構造体が追加されました。これにより、Goがより広範なプラットフォームで低レベルのOS機能にアクセスできるようになります。testing
: テストのスキップ機能が追加されました。これにより、特定の環境や条件に依存するテストを、その条件が満たされない場合にスキップできるようになり、テストスイートの実行効率と柔軟性が向上します。
これらの変更は、Go言語が進化し、より多くのユースケースに対応できるよう、標準ライブラリが継続的に改善されていることを示しています。
関連リンク
- Go言語の公式ドキュメント: https://golang.org/doc/
- Go言語のAPI互換性ポリシー: https://golang.org/doc/go1compat
- Go 1.1リリースノート (当時の次期リリース): https://golang.org/doc/go1.1
参考にした情報源リンク
- Go言語の公式リポジトリ: https://github.com/golang/go
- Go Code Review Comments (API変更のプロセスに関する情報): https://github.com/golang/go/wiki/CodeReviewComments
- Goの
api/next.txt
ファイルの役割に関する議論(Goコミュニティのフォーラムやメーリングリストなど) - 各パッケージのGoDocドキュメント (例:
bufio
パッケージ: https://pkg.go.dev/bufio)