From 1cd272d16ae59236ab63f9d8e55db98f3c5b80ee Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 8 Mar 2012 17:15:23 +1100 Subject: [PATCH] doc/go1: template packages have changed since r60 R=golang-dev, adg CC=golang-dev https://golang.org/cl/5787049 --- doc/go1.html | 52 ++++++++++++++++++++++++++++++++++++++++++---------- doc/go1.tmpl | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 84 insertions(+), 20 deletions(-) diff --git a/doc/go1.html b/doc/go1.html index 8d61363745..6d71037f2e 100644 --- a/doc/go1.html +++ b/doc/go1.html @@ -883,7 +883,7 @@ This behavior was unpleasant and unportable. In Go 1, the syscall package instead returns an error for system call errors. -On Unix, the implementation is done by a +On Unix, the implementation is done by a syscall.Errno type that satisfies error and replaces the old os.Errno.

@@ -910,7 +910,7 @@ and no distinction between absolute times and durations.

One of the most sweeping changes in the Go 1 library is therefore a -complete redesign of the +complete redesign of the time package. Instead of an integer number of nanoseconds as an int64, and a separate *time.Time type to deal with human @@ -1107,7 +1107,7 @@ to be implemented in the future. No changes will be needed.

-

The encoding/binary package

+

The encoding/binary package

In Go 1, the binary.TotalSize function has been replaced by @@ -1253,7 +1253,7 @@ The go/printer package supports an a configuration mode SourcePos; if set, the printer will emit //line comments such that the generated output contains the original source code position information. The new type -CommentedNode can be +CommentedNode can be used to provide comments associated with an arbitrary ast.Node (until now only ast.File carried comment information). @@ -1320,7 +1320,7 @@ to run-time errors.

In Go 1, the definition of hash.Hash includes -a new method, BlockSize. This new method is used primarily in the +a new method, BlockSize. This new method is used primarily in the cryptographic libraries.

@@ -1506,7 +1506,7 @@ Running go fix will update almost all code affected by

The log/syslog package

-In Go 1, the syslog.NewLogger +In Go 1, the syslog.NewLogger function returns an error as well as a log.Logger.

@@ -1521,7 +1521,7 @@ What little code is affected will be caught by the compiler and must be updated In Go 1, the FormatMediaType function of the mime package has been simplified to make it consistent with -ParseMediaType. +ParseMediaType. It now takes "text/html" rather than "text" and "html".

@@ -1535,9 +1535,9 @@ What little code is affected will be caught by the compiler and must be updated

In Go 1, the various SetTimeout, SetReadTimeout, and SetWriteTimeout methods -have been replaced with +have been replaced with SetDeadline, -SetReadDeadline, and +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 @@ -1808,7 +1808,7 @@ The compiler will catch code using the old interface.

The regexp package has been rewritten. -It has the same interface but the specification of the regular expressions +It has the same interface but the specification of the regular expressions it supports has changed from the old "egrep" form to that of RE2.

@@ -1953,6 +1953,38 @@ a cast that must be added by hand; the go fix tool wil

+

The template packages

+ +

+The template and exp/template/html packages have moved to +text/template and +html/template. +More significant, the interface to these packages has been simplified. +The template language is the same, but the concept of "template set" is gone +and the functions and methods of the packages have changed accordingly, +often by elimination. +

+ +

+Instead of sets, a Template object +may contain multiple named template definitions, +in effect constructing +name spaces for template invocation. +A template can invoke any other template associated with it, but only those +templates associated with it. +The simplest way to associate templates is to parse them together, something +made easier with the new structure of the packages. +

+ +

+Updating: +The imports will be updated by fix tool. +Single-template uses will be otherwise be largely unaffected. +Code that uses multiple templates in concert will need to be updated by hand. +The examples in +the documentation for text/template can provide guidance. +

+

The testing package

diff --git a/doc/go1.tmpl b/doc/go1.tmpl index dd72404c33..ae9f81a639 100644 --- a/doc/go1.tmpl +++ b/doc/go1.tmpl @@ -797,7 +797,7 @@ This behavior was unpleasant and unportable. In Go 1, the syscall package instead returns an error for system call errors. -On Unix, the implementation is done by a +On Unix, the implementation is done by a syscall.Errno type that satisfies error and replaces the old os.Errno.

@@ -824,7 +824,7 @@ and no distinction between absolute times and durations.

One of the most sweeping changes in the Go 1 library is therefore a -complete redesign of the +complete redesign of the time package. Instead of an integer number of nanoseconds as an int64, and a separate *time.Time type to deal with human @@ -1011,7 +1011,7 @@ to be implemented in the future. No changes will be needed.

-

The encoding/binary package

+

The encoding/binary package

In Go 1, the binary.TotalSize function has been replaced by @@ -1156,7 +1156,7 @@ The go/printer package supports an a configuration mode SourcePos; if set, the printer will emit //line comments such that the generated output contains the original source code position information. The new type -CommentedNode can be +CommentedNode can be used to provide comments associated with an arbitrary ast.Node (until now only ast.File carried comment information). @@ -1223,7 +1223,7 @@ to run-time errors.

In Go 1, the definition of hash.Hash includes -a new method, BlockSize. This new method is used primarily in the +a new method, BlockSize. This new method is used primarily in the cryptographic libraries.

@@ -1409,7 +1409,7 @@ Running go fix will update almost all code affected by

The log/syslog package

-In Go 1, the syslog.NewLogger +In Go 1, the syslog.NewLogger function returns an error as well as a log.Logger.

@@ -1424,7 +1424,7 @@ What little code is affected will be caught by the compiler and must be updated In Go 1, the FormatMediaType function of the mime package has been simplified to make it consistent with -ParseMediaType. +ParseMediaType. It now takes "text/html" rather than "text" and "html".

@@ -1438,9 +1438,9 @@ What little code is affected will be caught by the compiler and must be updated

In Go 1, the various SetTimeout, SetReadTimeout, and SetWriteTimeout methods -have been replaced with +have been replaced with SetDeadline, -SetReadDeadline, and +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 @@ -1693,7 +1693,7 @@ The compiler will catch code using the old interface.

The regexp package has been rewritten. -It has the same interface but the specification of the regular expressions +It has the same interface but the specification of the regular expressions it supports has changed from the old "egrep" form to that of RE2.

@@ -1838,6 +1838,38 @@ a cast that must be added by hand; the go fix tool wil

+

The template packages

+ +

+The template and exp/template/html packages have moved to +text/template and +html/template. +More significant, the interface to these packages has been simplified. +The template language is the same, but the concept of "template set" is gone +and the functions and methods of the packages have changed accordingly, +often by elimination. +

+ +

+Instead of sets, a Template object +may contain multiple named template definitions, +in effect constructing +name spaces for template invocation. +A template can invoke any other template associated with it, but only those +templates associated with it. +The simplest way to associate templates is to parse them together, something +made easier with the new structure of the packages. +

+ +

+Updating: +The imports will be updated by fix tool. +Single-template uses will be otherwise be largely unaffected. +Code that uses multiple templates in concert will need to be updated by hand. +The examples in +the documentation for text/template can provide guidance. +

+

The testing package

-- 2.50.0