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

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

このコミットは、Go言語の公式リポジトリにおける週次更新レポート weekly.2011-11-01 を追加するものです。具体的には、doc/devel/weekly.html ファイルに2011年11月1日時点でのGoプロジェクトの様々なコンポーネント(コンパイラ、標準ライブラリ、ツールなど)に対する変更点や修正、改善点をまとめたセクションが追加されています。また、関連して.hgtagsファイルから古い週次タグのエントリが削除されています。これは、Goプロジェクトが当時どのように開発の進捗をコミュニティに共有していたかを示す典型的な例です。

コミット

  • Author: Andrew Gerrand adg@golang.org
  • Date: Wed Nov 2 10:37:01 2011 +0900
  • Commit Message:
    weekly.2011-11-01
    
    R=rsc, r
    CC=golang-dev
    https://golang.org/cl/5336044
    

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

https://github.com/golang/go/commit/08757f722c84260399d3eb1236c0c1ed305e017a

元コミット内容

commit 08757f722c84260399d3eb1236c0c1ed305e017a
Author: Andrew Gerrand <adg@golang.org>
Date:   Wed Nov 2 10:37:01 2011 +0900

    weekly.2011-11-01
    
    R=rsc, r
    CC=golang-dev
    https://golang.org/cl/5336044
---
 .hgtags               |  1 -
 doc/devel/weekly.html | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 48 insertions(+), 1 deletion(-)\n\ndiff --git a/.hgtags b/.hgtags\nindex 3037b0d9b3..ccb12890fa 100644\n--- a/.hgtags\n+++ b/.hgtags\n@@ -90,4 +90,3 @@ acaddf1cea75c059d19b20dbef35b20fb3f38954 release.r58.2\n 6d7136d74b656ba6e1194853a9486375005227ef weekly.2011-10-18\n 941b8015061a0f6480954821dd589c60dfe35ed1 weekly.2011-10-25\n 7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly.2011-10-26\n-7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly\ndiff --git a/doc/devel/weekly.html b/doc/devel/weekly.html\nindex 5c68125e3c..67662563dd 100644\n--- a/doc/devel/weekly.html\n+++ b/doc/devel/weekly.html\n@@ -14,6 +14,54 @@ hg pull\n hg update weekly.<i>YYYY-MM-DD</i>\n </pre>\n \n+<h2 id=\"2011-11-01\">2011-11-01</h2>\n+\n+<pre>\n+* 6l: remove mention of -e flag - it does nothing.\n+* cc: change cas to newcase (thanks Ron Minnich).\n+* crypto/openpgp/error: use Error in names of error impl types.\n+* crypto/rsa: change public exponent from 3 to 65537.\n+* crypto/tls: add Error method to alert.\n+* doc: add link to A Tour of Go in Japanese,\n+\tadd \'all\' make rule to build all docs,\n+\trefer to tour.golang.org instead of go-tour.appspot.com.\n+* exp/norm: fixed bug that crept in with moving to the new regexp.\n+* exp/ssh: fix length header leaking into channel data (thanks Dave Cheney).\n+* fmt: handle os.Error values explicity (as distinct from Stringer).\n+* gc: clean up printing,\n+\tfix [568]g -V crash (thanks Mikio Hara),\n+\ttest + fix escape analysis bug.\n+* go/build: avoid os.Error in tests.\n+* go/doc: remove os.NewError anti-heuristic.\n+* go/parser: test and fix := scoping bug.\n+* gob: split uses of gobError, remove unnecessary embedding.\n+* gofix: test import insertion, deletion.\n+* goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).\n+* gopack: change archive file name length back to 16.\n+* html: fix print argument in test,\n+\tmore parser improvements (thanks Andrew Balholm).\n+* json: properly handle nil slices (thanks Alexander Reece).\n+* math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).\n+* misc/emacs: fix restoration of windows after gofmt (thanks Jan Newmarch).\n+* misc/vim: add rune keyword (thanks Jongmin Kim).\n+* misc/windows: can be used for amd64 (thanks Alex Brainman).\n+* net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).\n+* os: do not interpret 0-length read as EOF.\n+* pkg: remove .String() from some print arguments.\n+* rpc: avoid infinite loop on input error.\n+* runtime/pprof: document OS X being broken.\n+* runtime: lock the main goroutine to the main OS thread during init.\n+* spec: define that initialization is sequential.\n+* strconv: use better errors than os.EINVAL, os.ERANGE.\n+* syscall: fix Await msg on Plan 9 (thanks Andrey Mirtchovski).\n+* template: do not use error as stringer,\n+\tfix error checking on execute without parse (thanks Scott Lawrence).\n+* test/alias.go: additional tests.\n+* test: error-related fixes.\n+* textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.\n+* time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).\n</pre>\n+\n <h2 id=\"2011-10-26\">2011-10-26 (new rune type)</h2>\n \n <pre>\n```

## 変更の背景

このコミットは、Go言語プロジェクトの定期的な週次開発レポートの一環として作成されました。当時のGoプロジェクトでは、開発の進捗状況や主要な変更点をコミュニティに透明性高く共有するために、`doc/devel/weekly.html`というドキュメントで週ごとの更新をまとめていました。

この特定のコミットは、2011年11月1日までの週における様々なコンポーネントのバグ修正、機能改善、リファクタリングなどを集約し、公式ドキュメントに反映させることを目的としています。`.hgtags`からのエントリ削除は、おそらくタグ付け戦略の変更、具体的には汎用的な`weekly`タグではなく、日付付きの週次タグをより厳密に管理する方針への移行を示唆しています。

## 前提知識の解説

### Go言語の週次更新 (Weekly Updates)

Go言語プロジェクトは、初期の段階から開発の透明性を重視し、定期的に進捗状況を公開していました。この「週次更新」は、Goのコンパイラ、ランタイム、標準ライブラリ、ツールなど、多岐にわたるコンポーネントで行われた変更を簡潔にまとめたもので、開発者やコミュニティが最新の動向を把握するための重要な情報源でした。これは、現在のGoのリリースノートやブログ記事の原型とも言えるものです。

### `.hgtags` ファイル

`.hgtags`は、Mercurial(Hg)という分散型バージョン管理システムで使用されるファイルです。Gitのタグに相当する「タグ」の情報を管理するために使われます。Goプロジェクトは、初期にはMercurialを使用していましたが、後にGitに移行しました。このファイルは、特定のコミットハッシュとそれに対応するタグ名(例: `weekly.2011-11-01`)をマッピングしていました。このコミットで古い汎用的な`weekly`タグが削除されたのは、より具体的な日付ベースのタグ管理への移行を示しています。

### `doc/devel/weekly.html` ファイル

このHTMLファイルは、Goプロジェクトの週次更新レポートが掲載される公式ドキュメントでした。開発者はこのファイルに、その週に行われた主要な変更点を箇条書きで追加し、コミュニティに公開していました。このコミットでは、新しい週(2011-11-01)のセクションが追加され、その週にマージされた多数の変更がリストアップされています。

### Go言語の主要なコンポーネントと概念(当時)

コミット内容に登場するGo言語のコンポーネントや概念について、当時の文脈で簡単に解説します。

*   **6l, cc**: Goコンパイラのバックエンド(リンカ、Cコンパイラ)。当時のGoコンパイラは、`6g`(Goコンパイラ)、`6l`(リンカ)、`6a`(アセンブラ)などのツールチェーンで構成されていました。`6`はamd64アーキテクチャを指します。
*   **`crypto/openpgp`, `crypto/rsa`, `crypto/tls`**: Goの標準ライブラリに含まれる暗号化関連のパッケージ。OpenPGP、RSA暗号、TLS(Transport Layer Security)の実装が含まれます。
*   **`exp/norm`, `exp/ssh`**: `exp`は「experimental(実験的)」なパッケージを示すプレフィックスです。これらのパッケージはまだ安定版ではなく、開発中であることを示していました。
*   **`fmt`**: フォーマット済みI/Oを扱うパッケージ。`fmt.Println`などが含まれます。
*   **`os.Error` と `Stringer`**: 当時のGoでは、エラーは`os.Error`インターフェースで表現されていました。`Stringer`は`String() string`メソッドを持つインターフェースで、オブジェクトを文字列として表現するために使われます。このコミットでは、エラーハンドリングの改善や、`os.Error`と`Stringer`の区別に関する変更が見られます。
*   **`gc`**: Goコンパイラ(`go compiler`)。
*   **`go/build`, `go/doc`, `go/parser`**: Goのソースコードを解析、ビルド、ドキュメント生成するためのツールやライブラリ。
*   **`gob`**: Goのバイナリエンコーディング形式を扱うパッケージ。
*   **`gofix`**: 古いGoのコードを新しいAPIや構文に自動的に変換するツール。
*   **`goinstall`**: 当時のGoのパッケージ管理ツール。現在の`go get`の前身のようなものです。
*   **`gopack`**: Goのアーカイブファイルを扱うツール。
*   **`html`**: HTMLパーサーやテンプレートを扱うパッケージ。
*   **`json`**: JSONデータのエンコード/デコードを扱うパッケージ。
*   **`math`**: 数学関数を提供するパッケージ。
*   **`misc/emacs`, `misc/vim`, `misc/windows`**: Go開発に関連する様々なユーティリティやプラットフォーム固有の修正。
*   **`net`**: ネットワークI/Oを扱うパッケージ。
*   **`os`**: オペレーティングシステムとのインタフェースを提供するパッケージ。
*   **`pkg`**: パッケージ関連の内部的な変更。
*   **`rpc`**: リモートプロシージャコールを実装するためのパッケージ。
*   **`runtime/pprof`**: プロファイリングデータ(CPU、メモリなど)を生成するためのパッケージ。
*   **`runtime`**: Goのランタイムシステム。ガベージコレクタ、スケジューラ、ゴルーチンなどを管理します。
*   **`goroutine` と `OS thread`**: Goの並行処理の基本単位であるゴルーチンと、OSが提供するスレッド。Goランタイムは、複数のゴルーチンを少数のOSスレッドにマッピングして実行します。
*   **`spec`**: Go言語の仕様書。
*   **`strconv`**: 文字列と数値の変換を扱うパッケージ。
*   **`syscall`**: オペレーティングシステムのシステムコールを直接呼び出すためのパッケージ。
*   **`template`**: テキストやHTMLテンプレートを扱うパッケージ。
*   **`textproto`**: テキストベースのネットワークプロトコル(HTTPなど)を扱うための低レベルなパッケージ。
*   **`time`**: 時間を扱うパッケージ。
*   **`rune`**: Go言語におけるUnicodeコードポイントを表す型。

## 技術的詳細

このコミットで追加された週次レポート `2011-11-01` には、多岐にわたる変更点がリストアップされています。以下にその一部を抜粋し、当時のGo開発における課題や改善の方向性を解説します。

*   **コンパイラ/リンカ (`6l`, `gc`) の改善**:
    *   `6l: remove mention of -e flag - it does nothing.`:リンカの`-e`フラグが機能しないため、その言及を削除。これはツールの正確性を保つための修正です。
    *   `gc: fix [568]g -V crash (thanks Mikio Hara)`:コンパイラのクラッシュバグ修正。特定の条件下でコンパイラが異常終了する問題が解決されました。
    *   `gc: test + fix escape analysis bug.`:エスケープ解析のバグ修正とテストの追加。エスケープ解析は、変数がヒープに割り当てられるべきかスタックに割り当てられるべきかを決定するコンパイラの最適化です。このバグ修正は、メモリ効率の向上に寄与します。
*   **暗号化ライブラリ (`crypto/openpgp`, `crypto/rsa`, `crypto/tls`) の改善**:
    *   `crypto/openpgp/error: use Error in names of error impl types.`:エラー実装型の命名規則の統一。Goのエラーハンドリングの慣習に合わせた変更です。
    *   `crypto/rsa: change public exponent from 3 to 65537.`:RSA公開鍵の指数を3から65537に変更。65537(F4)はRSAで一般的に推奨される公開指数であり、セキュリティとパフォーマンスのバランスが取れています。
*   **ドキュメント (`doc`) の改善**:
    *   `doc: add link to A Tour of Go in Japanese`:Go言語のインタラクティブなチュートリアル「A Tour of Go」の日本語版へのリンクを追加。国際化への取り組みの一環です。
    *   `doc: refer to tour.golang.org instead of go-tour.appspot.com.`:Tour of GoのURLを新しいドメインに更新。
*   **エラーハンドリングの改善**:
    *   `fmt: handle os.Error values explicity (as distinct from Stringer).`:`fmt`パッケージが`os.Error`と`Stringer`を明確に区別して扱うように変更。これにより、エラーメッセージの出力がより正確になります。
    *   `go/build: avoid os.Error in tests.`、`go/doc: remove os.NewError anti-heuristic.`、`strconv: use better errors than os.EINVAL, os.ERANGE.`、`template: do not use error as stringer`:`os.Error`の利用方法やエラー生成に関する改善が複数行われています。これは、Goのエラーハンドリングの設計がまだ進化途上にあり、より堅牢で一貫性のある方法を模索していた時期であることを示しています。
*   **ツールの改善 (`gofix`, `goinstall`, `gopack`)**:
    *   `gofix: test import insertion, deletion.`:`gofix`ツールがimport文の挿入と削除を正しく扱えるようにテストを追加。
    *   `goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).`:`goinstall`が一般的なサイト(GitHubなど)でより賢くバージョン管理システムを選択できるよう改善。これは、パッケージ取得の利便性を向上させるものです。
*   **標準ライブラリのバグ修正と改善**:
    *   `json: properly handle nil slices (thanks Alexander Reece).`:JSONエンコーディングにおける`nil`スライスの扱いを修正。
    *   `math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).`:`math`パッケージの`Sin`と`Cos`関数の精度向上。
    *   `net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).`:Windows環境で`SO_REUSEADDR`を使用しない理由をドキュメント化。これは、ネットワークプログラミングにおけるプラットフォーム固有の挙動に関する重要な情報です。
    *   `runtime: lock the main goroutine to the main OS thread during init.`:初期化中にメインゴルーチンをメインOSスレッドにロックする変更。これは、特定のOS(特にmacOS)でのCgoとの連携や、GUIアプリケーションなど、メインスレッドに特定の処理を固定する必要がある場合の挙動を安定させるためのものです。
    *   `textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.`:HTTPヘッダーの長い行がHTTP 400エラーを引き起こすのを防ぐ修正。これは、HTTPプロトコルの堅牢性を高めるためのものです。
    *   `time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).`:`time`パッケージにRFC1123形式で数値タイムゾーンを扱う機能を追加。

これらの変更は、Go言語が当時まだ比較的新しい言語であり、様々なエッジケースやパフォーマンス、堅牢性の問題に直面しながらも、活発に開発が進められていたことを示しています。特に、エラーハンドリングの改善、ツールの利便性向上、標準ライブラリの安定化に重点が置かれていたことが伺えます。

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

このコミットにおけるコアとなるコードの変更は、以下の2つのファイルに集中しています。

1.  **`.hgtags`**:
    ```diff
    --- a/.hgtags
    +++ b/.hgtags
    @@ -90,4 +90,3 @@ acaddf1cea75c059d19b20dbef35b20fb3f38954 release.r58.2
     6d7136d74b656ba6e1194853a9486375005227ef weekly.2011-10-18
     941b8015061a0f6480954821dd589c60dfe35ed1 weekly.2011-10-25
     7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly.2011-10-26
    -7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly
    ```
    この変更では、`7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly`という行が削除されています。これは、特定のコミットハッシュに紐付けられた汎用的な`weekly`タグのエントリを削除するものです。

2.  **`doc/devel/weekly.html`**:
    ```diff
    --- a/doc/devel/weekly.html
    +++ b/doc/devel/weekly.html
    @@ -14,6 +14,54 @@ hg pull
     hg update weekly.<i>YYYY-MM-DD</i>
     </pre>\n \n+<h2 id=\"2011-11-01\">2011-11-01</h2>\n+\n+<pre>\n+* 6l: remove mention of -e flag - it does nothing.\n+* cc: change cas to newcase (thanks Ron Minnich).\n+* crypto/openpgp/error: use Error in names of error impl types.\n+* crypto/rsa: change public exponent from 3 to 65537.\n+* crypto/tls: add Error method to alert.\n+* doc: add link to A Tour of Go in Japanese,\n+\tadd \'all\' make rule to build all docs,\n+\trefer to tour.golang.org instead of go-tour.appspot.com.\n+* exp/norm: fixed bug that crept in with moving to the new regexp.\n+* exp/ssh: fix length header leaking into channel data (thanks Dave Cheney).\n+* fmt: handle os.Error values explicity (as distinct from Stringer).\n+* gc: clean up printing,\n+\tfix [568]g -V crash (thanks Mikio Hara),\n+\ttest + fix escape analysis bug.\n+* go/build: avoid os.Error in tests.\n+* go/doc: remove os.NewError anti-heuristic.\n+* go/parser: test and fix := scoping bug.\n+* gob: split uses of gobError, remove unnecessary embedding.\n+* gofix: test import insertion, deletion.\n+* goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).\n+* gopack: change archive file name length back to 16.\n+* html: fix print argument in test,\n+\tmore parser improvements (thanks Andrew Balholm).\n+* json: properly handle nil slices (thanks Alexander Reece).\n+* math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).\n+* misc/emacs: fix restoration of windows after gofmt (thanks Jan Newmarch).\n+* misc/vim: add rune keyword (thanks Jongmin Kim).\n+* misc/windows: can be used for amd64 (thanks Alex Brainman).\n+* net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).\n+* os: do not interpret 0-length read as EOF.\n+* pkg: remove .String() from some print arguments.\n+* rpc: avoid infinite loop on input error.\n+* runtime/pprof: document OS X being broken.\n+* runtime: lock the main goroutine to the main OS thread during init.\n+* spec: define that initialization is sequential.\n+* strconv: use better errors than os.EINVAL, os.ERANGE.\n+* syscall: fix Await msg on Plan 9 (thanks Andrey Mirtchovski).\n+* template: do not use error as stringer,\n+\tfix error checking on execute without parse (thanks Scott Lawrence).\n+* test/alias.go: additional tests.\n+* test: error-related fixes.\n+* textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.\n+* time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).\n    </pre>\n    ```
    この変更では、`doc/devel/weekly.html`に新しい`<h2>`タグで始まる`2011-11-01`のセクションが追加され、その下に箇条書きで多数の変更点が列挙されています。

## コアとなるコードの解説

### `.hgtags` の変更

`.hgtags`ファイルから`7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly`という行が削除されたのは、GoプロジェクトがMercurialを使用していた時期のタグ管理戦略の変更を示唆しています。以前は、最新の週次更新を示す汎用的な`weekly`タグが存在した可能性があります。しかし、このコミットでは、`weekly.2011-10-18`、`weekly.2011-10-25`、`weekly.2011-10-26`といった日付付きの週次タグが既に存在していることが示されています。

この変更の意図は、おそらく以下のいずれか、または両方です。
*   **タグの明確化**: 汎用的な`weekly`タグは、どの時点の週次更新を指すのか曖昧になる可能性があります。日付付きのタグに統一することで、特定の週の更新を明確に識別できるようになります。
*   **管理の簡素化**: 常に最新の週次更新を指す`weekly`タグを更新し続けるよりも、日付ごとに新しいタグを追加する方が、管理がシンプルになる場合があります。

この変更自体はGoのコードの機能に直接影響を与えるものではなく、バージョン管理とリリース管理のプロセスに関するものです。

### `doc/devel/weekly.html` の変更

`doc/devel/weekly.html`ファイルへの変更は、このコミットの主要な目的であり、Goプロジェクトの進捗をコミュニティに伝えるためのものです。

*   **新しいセクションの追加**: `<h2>2011-11-01</h2>`という見出しで新しいセクションが追加されています。これは、2011年11月1日までの週に行われた変更をまとめるためのものです。
*   **変更点のリストアップ**: `<pre>`タグ内に、その週にマージされた多数の変更点が箇条書きで詳細に記述されています。各項目は、影響を受けたコンポーネント(例: `6l`, `crypto/rsa`, `doc`, `fmt`, `gc`など)と、その変更内容を簡潔に説明しています。
    *   例えば、`crypto/rsa: change public exponent from 3 to 65537.`という項目は、RSA暗号の実装において公開鍵の指数が変更されたことを示しています。これはセキュリティ上の推奨事項に従った改善です。
    *   `doc: add link to A Tour of Go in Japanese`は、Goの学習リソースの国際化への取り組みを示しています。
    *   `runtime: lock the main goroutine to the main OS thread during init.`は、Goのランタイムにおける重要な変更で、特定のプラットフォームでの安定性やCgoとの連携を改善するためのものです。

このHTMLファイルの更新は、Go開発チームが定期的に内部的な変更を整理し、外部に公開するプロセスの一部でした。これにより、Go言語の進化の過程が透明に記録され、開発者やユーザーがその動向を追跡できるようになっていました。

## 関連リンク

*   GitHub上のコミットページ: [https://github.com/golang/go/commit/08757f722c84260399d3eb1236c0c1ed305e017a](https://github.com/golang/go/commit/08757f722c84260399d3eb1236c0c1ed305e017a)
*   Go Code Review (Gerrit) の変更リスト: [https://golang.org/cl/5336044](https://golang.org/cl/5336044) (当時のGoプロジェクトが使用していたコードレビューシステム)

## 参考にした情報源リンク

*   Go言語公式ドキュメント (当時の週次更新の形式を理解するため)
*   Mercurial (Hg) のドキュメント (`.hgtags`の役割を理解するため)
*   Go言語のエラーハンドリングに関する歴史的経緯や`os.Error`に関する情報
*   Go言語のランタイム、ゴルーチン、OSスレッドに関する情報
*   RSA暗号の公開指数に関する一般的な情報
*   Go言語のツール(`gofix`, `goinstall`など)に関する当時の情報
*   Go言語の各パッケージ(`crypto`, `fmt`, `json`, `net`, `runtime`, `strconv`, `syscall`, `textproto`, `time`など)の当時の機能と役割に関する情報

(注:具体的なURLは、当時の情報源が現在も利用可能であるか確認が難しいため、一般的なカテゴリで記載しています。)
# [インデックス 10174] ファイルの概要

このコミットは、Go言語の公式リポジトリにおける週次更新レポート `weekly.2011-11-01` を追加するものです。具体的には、`doc/devel/weekly.html` ファイルに2011年11月1日時点でのGoプロジェクトの様々なコンポーネント(コンパイラ、標準ライブラリ、ツールなど)に対する変更点や修正、改善点をまとめたセクションが追加されています。また、関連して`.hgtags`ファイルから古い週次タグのエントリが削除されています。これは、Goプロジェクトが当時どのように開発の進捗をコミュニティに共有していたかを示す典型的な例です。

## コミット

*   **Author**: Andrew Gerrand <adg@golang.org>
*   **Date**: Wed Nov 2 10:37:01 2011 +0900
*   **Commit Message**:
    ```
    weekly.2011-11-01

    R=rsc, r
    CC=golang-dev
    https://golang.org/cl/5336044
    ```

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

[https://github.com/golang/go/commit/08757f722c84260399d3eb1236c0c1ed305e017a](https://github.com/golang/go/commit/08757f722c84260399d3eb1236c0c1ed305e017a)

## 元コミット内容

commit 08757f722c84260399d3eb1236c0c1ed305e017a Author: Andrew Gerrand adg@golang.org Date: Wed Nov 2 10:37:01 2011 +0900

weekly.2011-11-01

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

.hgtags | 1 - doc/devel/weekly.html | 48 ++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 48 insertions(+), 1 deletion(-)\n\ndiff --git a/.hgtags b/.hgtags\nindex 3037b0d9b3..ccb12890fa 100644\n--- a/.hgtags\n+++ b/.hgtags\n@@ -90,4 +90,3 @@ acaddf1cea75c059d19b20dbef35b20fb3f38954 release.r58.2\n 6d7136d74b656ba6e1194853a9486375005227ef weekly.2011-10-18\n 941b8015061a0f6480954821dd589c60dfe35ed1 weekly.2011-10-25\n 7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly.2011-10-26\n-7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly\ndiff --git a/doc/devel/weekly.html b/doc/devel/weekly.html\nindex 5c68125e3c..67662563dd 100644\n--- a/doc/devel/weekly.html\n+++ b/doc/devel/weekly.html\n@@ -14,6 +14,54 @@ hg pull\n hg update weekly.YYYY-MM-DD\n \n \n+<h2 id="2011-11-01">2011-11-01\n+\n+

\n+* 6l: remove mention of -e flag - it does nothing.\n+* cc: change cas to newcase (thanks Ron Minnich).\n+* crypto/openpgp/error: use Error in names of error impl types.\n+* crypto/rsa: change public exponent from 3 to 65537.\n+* crypto/tls: add Error method to alert.\n+* doc: add link to A Tour of Go in Japanese,\n+\tadd 'all' make rule to build all docs,\n+\trefer to tour.golang.org instead of go-tour.appspot.com.\n+* exp/norm: fixed bug that crept in with moving to the new regexp.\n+* exp/ssh: fix length header leaking into channel data (thanks Dave Cheney).\n+* fmt: handle os.Error values explicity (as distinct from Stringer).\n+* gc: clean up printing,\n+\tfix [568]g -V crash (thanks Mikio Hara),\n+\ttest + fix escape analysis bug.\n+* go/build: avoid os.Error in tests.\n+* go/doc: remove os.NewError anti-heuristic.\n+* go/parser: test and fix := scoping bug.\n+* gob: split uses of gobError, remove unnecessary embedding.\n+* gofix: test import insertion, deletion.\n+* goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).\n+* gopack: change archive file name length back to 16.\n+* html: fix print argument in test,\n+\tmore parser improvements (thanks Andrew Balholm).\n+* json: properly handle nil slices (thanks Alexander Reece).\n+* math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).\n+* misc/emacs: fix restoration of windows after gofmt (thanks Jan Newmarch).\n+* misc/vim: add rune keyword (thanks Jongmin Kim).\n+* misc/windows: can be used for amd64 (thanks Alex Brainman).\n+* net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).\n+* os: do not interpret 0-length read as EOF.\n+* pkg: remove .String() from some print arguments.\n+* rpc: avoid infinite loop on input error.\n+* runtime/pprof: document OS X being broken.\n+* runtime: lock the main goroutine to the main OS thread during init.\n+* spec: define that initialization is sequential.\n+* strconv: use better errors than os.EINVAL, os.ERANGE.\n+* syscall: fix Await msg on Plan 9 (thanks Andrey Mirtchovski).\n+* template: do not use error as stringer,\n+\tfix error checking on execute without parse (thanks Scott Lawrence).\n+* test/alias.go: additional tests.\n+* test: error-related fixes.\n+* textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.\n+* time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).\n
\n+\n <h2 id="2011-10-26">2011-10-26 (new rune type)\n \n
\n```

変更の背景

このコミットは、Go言語プロジェクトの定期的な週次開発レポートの一環として作成されました。当時のGoプロジェクトでは、開発の進捗状況や主要な変更点をコミュニティに透明性高く共有するために、doc/devel/weekly.htmlというドキュメントで週ごとの更新をまとめていました。

この特定のコミットは、2011年11月1日までの週における様々なコンポーネントのバグ修正、機能改善、リファクタリングなどを集約し、公式ドキュメントに反映させることを目的としています。.hgtagsからのエントリ削除は、おそらくタグ付け戦略の変更、具体的には汎用的なweeklyタグではなく、日付付きの週次タグをより厳密に管理する方針への移行を示唆しています。

前提知識の解説

Go言語の週次更新 (Weekly Updates)

Go言語プロジェクトは、初期の段階から開発の透明性を重視し、定期的に進捗状況を公開していました。この「週次更新」は、Goのコンパイラ、ランタイム、標準ライブラリ、ツールなど、多岐にわたるコンポーネントで行われた変更を簡潔にまとめたもので、開発者やコミュニティが最新の動向を把握するための重要な情報源でした。これは、現在のGoのリリースノートやブログ記事の原型とも言えるものです。

.hgtags ファイル

.hgtagsは、Mercurial(Hg)という分散型バージョン管理システムで使用されるファイルです。Gitのタグに相当する「タグ」の情報を管理するために使われます。Goプロジェクトは、初期にはMercurialを使用していましたが、後にGitに移行しました。このファイルは、特定のコミットハッシュとそれに対応するタグ名(例: weekly.2011-11-01)をマッピングしていました。このコミットで古い汎用的なweeklyタグが削除されたのは、より具体的な日付ベースのタグ管理への移行を示しています。

doc/devel/weekly.html ファイル

このHTMLファイルは、Goプロジェクトの週次更新レポートが掲載される公式ドキュメントでした。開発者はこのファイルに、その週に行われた主要な変更点を箇条書きで追加し、コミュニティに公開していました。このコミットでは、新しい週(2011-11-01)のセクションが追加され、その週にマージされた多数の変更がリストアップされています。

Go言語の主要なコンポーネントと概念(当時)

コミット内容に登場するGo言語のコンポーネントや概念について、当時の文脈で簡単に解説します。

  • 6l, cc: Goコンパイラのバックエンド(リンカ、Cコンパイラ)。当時のGoコンパイラは、6g(Goコンパイラ)、6l(リンカ)、6a(アセンブラ)などのツールチェーンで構成されていました。6はamd64アーキテクチャを指します。
  • crypto/openpgp, crypto/rsa, crypto/tls: Goの標準ライブラリに含まれる暗号化関連のパッケージ。OpenPGP、RSA暗号、TLS(Transport Layer Security)の実装が含まれます。
  • exp/norm, exp/ssh: expは「experimental(実験的)」なパッケージを示すプレフィックスです。これらのパッケージはまだ安定版ではなく、開発中であることを示していました。
  • fmt: フォーマット済みI/Oを扱うパッケージ。fmt.Printlnなどが含まれます。
  • os.ErrorStringer: 当時のGoでは、エラーはos.Errorインターフェースで表現されていました。StringerString() stringメソッドを持つインターフェースで、オブジェクトを文字列として表現するために使われます。このコミットでは、エラーハンドリングの改善や、os.ErrorStringerの区別に関する変更が見られます。
  • gc: Goコンパイラ(go compiler)。
  • go/build, go/doc, go/parser: Goのソースコードを解析、ビルド、ドキュメント生成するためのツールやライブラリ。
  • gob: Goのバイナリエンコーディング形式を扱うパッケージ。
  • gofix: 古いGoのコードを新しいAPIや構文に自動的に変換するツール。
  • goinstall: 当時のGoのパッケージ管理ツール。現在のgo getの前身のようなものです。
  • gopack: Goのアーカイブファイルを扱うツール。
  • html: HTMLパーサーやテンプレートを扱うパッケージ。
  • json: JSONデータのエンコード/デコードを扱うパッケージ。
  • math: 数学関数を提供するパッケージ。
  • misc/emacs, misc/vim, misc/windows: Go開発に関連する様々なユーティリティやプラットフォーム固有の修正。
  • net: ネットワークI/Oを扱うパッケージ。
  • os: オペレーティングシステムとのインタフェースを提供するパッケージ。
  • pkg: パッケージ関連の内部的な変更。
  • rpc: リモートプロシージャコールを実装するためのパッケージ。
  • runtime/pprof: プロファイリングデータ(CPU、メモリなど)を生成するためのパッケージ。
  • runtime: Goのランタイムシステム。ガベージコレクタ、スケジューラ、ゴルーチンなどを管理します。
  • goroutineOS thread: Goの並行処理の基本単位であるゴルーチンと、OSが提供するスレッド。Goランタイムは、複数のゴルーチンを少数のOSスレッドにマッピングして実行します。
  • spec: Go言語の仕様書。
  • strconv: 文字列と数値の変換を扱うパッケージ。
  • syscall: オペレーティングシステムのシステムコールを直接呼び出すためのパッケージ。
  • template: テキストやHTMLテンプレートを扱うパッケージ。
  • textproto: テキストベースのネットワークプロトコル(HTTPなど)を扱うための低レベルなパッケージ。
  • time: 時間を扱うパッケージ。
  • rune: Go言語におけるUnicodeコードポイントを表す型。

技術的詳細

このコミットで追加された週次レポート 2011-11-01 には、多岐にわたる変更点がリストアップされています。以下にその一部を抜粋し、当時のGo開発における課題や改善の方向性を解説します。

  • コンパイラ/リンカ (6l, gc) の改善:
    • 6l: remove mention of -e flag - it does nothing.:リンカの-eフラグが機能しないため、その言及を削除。これはツールの正確性を保つための修正です。
    • gc: fix [568]g -V crash (thanks Mikio Hara):コンパイラのクラッシュバグ修正。特定の条件下でコンパイラが異常終了する問題が解決されました。
    • gc: test + fix escape analysis bug.:エスケープ解析のバグ修正とテストの追加。エスケープ解析は、変数がヒープに割り当てられるべきかスタックに割り当てられるべきかを決定するコンパイラの最適化です。このバグ修正は、メモリ効率の向上に寄与します。
  • 暗号化ライブラリ (crypto/openpgp, crypto/rsa, crypto/tls) の改善:
    • crypto/openpgp/error: use Error in names of error impl types.:エラー実装型の命名規則の統一。Goのエラーハンドリングの慣習に合わせた変更です。
    • crypto/rsa: change public exponent from 3 to 65537.:RSA公開鍵の指数を3から65537に変更。65537(F4)はRSAで一般的に推奨される公開指数であり、セキュリティとパフォーマンスのバランスが取れています。
  • ドキュメント (doc) の改善:
    • doc: add link to A Tour of Go in Japanese:Go言語のインタラクティブなチュートリアル「A Tour of Go」の日本語版へのリンクを追加。国際化への取り組みの一環です。
    • doc: refer to tour.golang.org instead of go-tour.appspot.com.:Tour of GoのURLを新しいドメインに更新。
  • エラーハンドリングの改善:
    • fmt: handle os.Error values explicity (as distinct from Stringer).fmtパッケージがos.ErrorStringerを明確に区別して扱うように変更。これにより、エラーメッセージの出力がより正確になります。
    • go/build: avoid os.Error in tests.go/doc: remove os.NewError anti-heuristic.strconv: use better errors than os.EINVAL, os.ERANGE.template: do not use error as stringeros.Errorの利用方法やエラー生成に関する改善が複数行われています。これは、Goのエラーハンドリングの設計がまだ進化途上にあり、より堅牢で一貫性のある方法を模索していた時期であることを示しています。
  • ツールの改善 (gofix, goinstall, gopack):
    • gofix: test import insertion, deletion.gofixツールがimport文の挿入と削除を正しく扱えるようにテストを追加。
    • goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).goinstallが一般的なサイト(GitHubなど)でより賢くバージョン管理システムを選択できるよう改善。これは、パッケージ取得の利便性を向上させるものです。
  • 標準ライブラリのバグ修正と改善:
    • json: properly handle nil slices (thanks Alexander Reece).:JSONエンコーディングにおけるnilスライスの扱いを修正。
    • math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).mathパッケージのSinCos関数の精度向上。
    • net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).:Windows環境でSO_REUSEADDRを使用しない理由をドキュメント化。これは、ネットワークプログラミングにおけるプラットフォーム固有の挙動に関する重要な情報です。
    • runtime: lock the main goroutine to the main OS thread during init.:初期化中にメインゴルーチンをメインOSスレッドにロックする変更。これは、特定のOS(特にmacOS)でのCgoとの連携や、GUIアプリケーションなど、メインスレッドに特定の処理を固定する必要がある場合の挙動を安定させるためのものです。
    • textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.:HTTPヘッダーの長い行がHTTP 400エラーを引き起こすのを防ぐ修正。これは、HTTPプロトコルの堅牢性を高めるためのものです。
    • time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).timeパッケージにRFC1123形式で数値タイムゾーンを扱う機能を追加。

これらの変更は、Go言語が当時まだ比較的新しい言語であり、様々なエッジケースやパフォーマンス、堅牢性の問題に直面しながらも、活発に開発が進められていたことを示しています。特に、エラーハンドリングの改善、ツールの利便性向上、標準ライブラリの安定化に重点が置かれていたことが伺えます。

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

このコミットにおけるコアとなるコードの変更は、以下の2つのファイルに集中しています。

  1. .hgtags:

    --- a/.hgtags
    +++ b/.hgtags
    @@ -90,4 +90,3 @@ acaddf1cea75c059d19b20dbef35b20fb3f38954 release.r58.2
     6d7136d74b656ba6e1194853a9486375005227ef weekly.2011-10-18
     941b8015061a0f6480954821dd589c60dfe35ed1 weekly.2011-10-25
     7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly.2011-10-26
    -7c1f789e6efd153951e85e3f28722fc69efc2af2 weekly
    

    この変更では、7c1f789e6efd153951e85e3f28722fc69efc2af2 weeklyという行が削除されています。これは、特定のコミットハッシュに紐付けられた汎用的なweeklyタグのエントリを削除するものです。

  2. doc/devel/weekly.html:

    --- a/doc/devel/weekly.html
    +++ b/doc/devel/weekly.html
    @@ -14,6 +14,54 @@ hg pull
     hg update weekly.<i>YYYY-MM-DD</i>
     </pre>\n \n+<h2 id=\"2011-11-01\">2011-11-01</h2>\n+\n+<pre>\n+* 6l: remove mention of -e flag - it does nothing.\n+* cc: change cas to newcase (thanks Ron Minnich).\n+* crypto/openpgp/error: use Error in names of error impl types.\n+* crypto/rsa: change public exponent from 3 to 65537.\n+* crypto/tls: add Error method to alert.\n+* doc: add link to A Tour of Go in Japanese,\n+\tadd \'all\' make rule to build all docs,\n+\trefer to tour.golang.org instead of go-tour.appspot.com.\n+* exp/norm: fixed bug that crept in with moving to the new regexp.\n+* exp/ssh: fix length header leaking into channel data (thanks Dave Cheney).\n+* fmt: handle os.Error values explicity (as distinct from Stringer).\n+* gc: clean up printing,\n+\tfix [568]g -V crash (thanks Mikio Hara),\n+\ttest + fix escape analysis bug.\n+* go/build: avoid os.Error in tests.\n+* go/doc: remove os.NewError anti-heuristic.\n+* go/parser: test and fix := scoping bug.\n+* gob: split uses of gobError, remove unnecessary embedding.\n+* gofix: test import insertion, deletion.\n+* goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).\n+* gopack: change archive file name length back to 16.\n+* html: fix print argument in test,\n+\tmore parser improvements (thanks Andrew Balholm).\n+* json: properly handle nil slices (thanks Alexander Reece).\n+* math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).\n+* misc/emacs: fix restoration of windows after gofmt (thanks Jan Newmarch).\n+* misc/vim: add rune keyword (thanks Jongmin Kim).\n+* misc/windows: can be used for amd64 (thanks Alex Brainman).\n+* net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).\n+* os: do not interpret 0-length read as EOF.\n+* pkg: remove .String() from some print arguments.\n+* rpc: avoid infinite loop on input error.\n+* runtime/pprof: document OS X being broken.\n+* runtime: lock the main goroutine to the main OS thread during init.\n+* spec: define that initialization is sequential.\n+* strconv: use better errors than os.EINVAL, os.ERANGE.\n+* syscall: fix Await msg on Plan 9 (thanks Andrey Mirtchovski).\n+* template: do not use error as stringer,\n+\tfix error checking on execute without parse (thanks Scott Lawrence).\n+* test/alias.go: additional tests.\n+* test: error-related fixes.\n+* textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.\n+* time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).\n    </pre>\n    ```
    この変更では、`doc/devel/weekly.html`に新しい`<h2>`タグで始まる`2011-11-01`のセクションが追加され、その下に箇条書きで多数の変更点が列挙されています。
    
    

コアとなるコードの解説

.hgtags の変更

.hgtagsファイルから7c1f789e6efd153951e85e3f28722fc69efc2af2 weeklyという行が削除されたのは、GoプロジェクトがMercurialを使用していた時期のタグ管理戦略の変更を示唆しています。以前は、最新の週次更新を示す汎用的なweeklyタグが存在した可能性があります。しかし、このコミットでは、weekly.2011-10-18weekly.2011-10-25weekly.2011-10-26といった日付付きの週次タグが既に存在していることが示されています。

この変更の意図は、おそらく以下のいずれか、または両方です。

  • タグの明確化: 汎用的なweeklyタグは、どの時点の週次更新を指すのか曖昧になる可能性があります。日付付きのタグに統一することで、特定の週の更新を明確に識別できるようになります。
  • 管理の簡素化: 常に最新の週次更新を指すweeklyタグを更新し続けるよりも、日付ごとに新しいタグを追加する方が、管理がシンプルになる場合があります。

この変更自体はGoのコードの機能に直接影響を与えるものではなく、バージョン管理とリリース管理のプロセスに関するものです。

doc/devel/weekly.html の変更

doc/devel/weekly.htmlファイルへの変更は、このコミットの主要な目的であり、Goプロジェクトの進捗をコミュニティに伝えるためのものです。

  • 新しいセクションの追加: <h2>2011-11-01</h2>という見出しで新しいセクションが追加されています。これは、2011年11月1日までの週に行われた変更をまとめるためのものです。
  • 変更点のリストアップ: <pre>タグ内に、その週にマージされた多数の変更点が箇条書きで詳細に記述されています。各項目は、影響を受けたコンポーネント(例: 6l, crypto/rsa, doc, fmt, gcなど)と、その変更内容を簡潔に説明しています。
    • 例えば、crypto/rsa: change public exponent from 3 to 65537.という項目は、RSA暗号の実装において公開鍵の指数が変更されたことを示しています。これはセキュリティ上の推奨事項に従った改善です。
    • doc: add link to A Tour of Go in Japaneseは、Goの学習リソースの国際化への取り組みを示しています。
    • runtime: lock the main goroutine to the main OS thread during init.は、Goのランタイムにおける重要な変更で、特定のプラットフォームでの安定性やCgoとの連携を改善するためのものです。

このHTMLファイルの更新は、Go開発チームが定期的に内部的な変更を整理し、外部に公開するプロセスの一部でした。これにより、Go言語の進化の過程が透明に記録され、開発者やユーザーがその動向を追跡できるようになっていました。

関連リンク

参考にした情報源リンク

  • Go言語公式ドキュメント (当時の週次更新の形式を理解するため)
  • Mercurial (Hg) のドキュメント (.hgtagsの役割を理解するため)
  • Go言語のエラーハンドリングに関する歴史的経緯やos.Errorに関する情報
  • Go言語のランタイム、ゴルーチン、OSスレッドに関する情報
  • RSA暗号の公開指数に関する一般的な情報
  • Go言語のツール(gofix, goinstallなど)に関する当時の情報
  • Go言語の各パッケージ(crypto, fmt, json, net, runtime, strconv, syscall, textproto, timeなど)の当時の機能と役割に関する情報

(注:具体的なURLは、当時の情報源が現在も利用可能であるか確認が難しいため、一般的なカテゴリで記載しています。)