From 03ea8b1c811007bb0c33effb782628e290f914a4 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 24 Jan 2012 16:36:40 -0800 Subject: [PATCH] doc/go1: add more info about hash and net changes, delete reference to html R=golang-dev, adg CC=golang-dev https://golang.org/cl/5570060 --- doc/go1.html | 39 ++++++++++++++++++++++++++++----------- doc/go1.tmpl | 39 ++++++++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/doc/go1.html b/doc/go1.html index e92be1d6bcf..b69bd6e89b8 100644 --- a/doc/go1.html +++ b/doc/go1.html @@ -948,18 +948,20 @@ a new method, BlockSize. This new method is used primarily in the cryptographic libraries.

+

+The Sum method of the +hash.Hash interface now takes a +[]byte argument, to which the hash value will be appended. +The previous behavior can be recreated by adding a nil argument to the call. +

+

Updating: Existing implementations of hash.Hash will need to add a BlockSize method. Hashes that process the input one byte at a time can implement BlockSize to return 1. -

- -

The html package

- -

-The html package in Go 1 provides -a full parser for HTML5. +Gofix will update calls to the Sum methods of the various +implementations of hash.Hash.

@@ -1124,14 +1126,29 @@ Gofix will update almost all code affected by the change.

The net package

-

In Go 1, the various SetTimeout, +

+In Go 1, the various SetTimeout, SetReadTimeout, and SetWriteTimeout methods -have been replaced with SetDeadline, -SetReadDeadline, and SetWriteDeadline, +have been replaced with +SetDeadline, +SetReadDeadline, and +SetWriteDeadline, respectively. Rather than taking a timeout value in nanoseconds that apply to any activity on the connection, the new methods set an absolute deadline (as a time.Time value) after which -reads and writes will time out and no longer block.

+reads and writes will time out and no longer block. +

+ +

+There is also a new net.DialTimeout method to simplify +timing out dialing a network address. +

+ +

+Updating: +Code that uses the old methods will fail to compile and must be updated by hand. +The semantic change makes it difficult for gofix to update automatically. +

The os.FileInfo type

diff --git a/doc/go1.tmpl b/doc/go1.tmpl index a06db82ffb4..59c78d2a40d 100644 --- a/doc/go1.tmpl +++ b/doc/go1.tmpl @@ -851,18 +851,20 @@ a new method, BlockSize. This new method is used primarily in the cryptographic libraries.

+

+The Sum method of the +hash.Hash interface now takes a +[]byte argument, to which the hash value will be appended. +The previous behavior can be recreated by adding a nil argument to the call. +

+

Updating: Existing implementations of hash.Hash will need to add a BlockSize method. Hashes that process the input one byte at a time can implement BlockSize to return 1. -

- -

The html package

- -

-The html package in Go 1 provides -a full parser for HTML5. +Gofix will update calls to the Sum methods of the various +implementations of hash.Hash.

@@ -1027,14 +1029,29 @@ Gofix will update almost all code affected by the change.

The net package

-

In Go 1, the various SetTimeout, +

+In Go 1, the various SetTimeout, SetReadTimeout, and SetWriteTimeout methods -have been replaced with SetDeadline, -SetReadDeadline, and SetWriteDeadline, +have been replaced with +SetDeadline, +SetReadDeadline, and +SetWriteDeadline, respectively. Rather than taking a timeout value in nanoseconds that apply to any activity on the connection, the new methods set an absolute deadline (as a time.Time value) after which -reads and writes will time out and no longer block.

+reads and writes will time out and no longer block. +

+ +

+There is also a new net.DialTimeout method to simplify +timing out dialing a network address. +

+ +

+Updating: +Code that uses the old methods will fail to compile and must be updated by hand. +The semantic change makes it difficult for gofix to update automatically. +

The os.FileInfo type