diff --git a/doc/go1.html b/doc/go1.html index da31b914082..9b62d1a1ad1 100644 --- a/doc/go1.html +++ b/doc/go1.html @@ -867,6 +867,40 @@ longer has a Write method. Its presence was a mistake. and must be updated by hand. Such code is almost certainly incorrect.

+

The bufio package

+ +

+In Go 1, bufio.NewReaderSize +and +bufio.NewWriterSize +functions no longer return an error for invalid sizes. +If the argument size is too small or invalid, it is adjusted. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The compress/flate, compress/gzip and compress/zlib packages

+ +

+In Go 1, the NewWriterXxx functions in +compress/flate, +compress/gzip and +compress/zlib +all return (*Writer, error) if they take a compression level, +and *Writer otherwise. Package gzip's +Compressor and Decompressor types have been renamed +to Writer and Reader. Package flate's +WrongValueError type has been removed. +

+ +

+Updating +What little code is affected will be caught by the compiler and must be updated by hand. +

+

The crypto/aes and crypto/des packages

@@ -936,6 +970,63 @@ to be implemented in the future. No changes will be needed.

+

The encoding/binary package

+ +

+In Go 1, the binary.TotalSize function has been replaced by +Size, +which takes an interface{} argument rather than +a reflect.Value. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The encoding/xml package

+ +

+In Go 1, the xml package +has been brought closer in design to the other marshaling packages such +as encoding/gob. +

+ +

+The old Parser type is renamed +Decoder and has a new +Decode method. An +Encoder type was also introducted. +

+ +

+The functions Marshal +and Unmarshal +work with []byte values now. To work with streams, +use the new Encoder +and Decoder types. +

+ +

+When marshaling or unmarshaling values, the format of supported flags in +field tags has changed to be closer to the +json package +(`xml:"name,flag"`). The matching done between field tags, field +names, and the XML attribute and element names is now case-sensitive. +The XMLName field tag, if present, must also match the name +of the XML element being marshaled. +

+ +

+Updating: +Running go fix will update most uses of the package except for some calls to +Unmarshal. Special care must be taken with field tags, +since the fix tool will not update them and if not fixed by hand they will +misbehave silently in some cases. For example, the old +"attr" is now written ",attr" while plain +"attr" remains valid but with a different meaning. +

+

The expvar package

@@ -985,6 +1076,15 @@ The Duration flag is new and affects no existing code. Several packages under go have slightly revised APIs.

+

+A concrete Mode type was introduced for configuration mode flags +in the packages +go/scanner, +go/parser, +go/printer, and +go/doc. +

+

The modes AllowIllegalChars and InsertSemis have been removed from the go/scanner package. They were mostly @@ -993,6 +1093,16 @@ useful for scanning text other then Go source files. Instead, the for that purpose.

+

+The ErrorHandler provided +to the scanner's Init method is +now simply a function rather than an interface. The ErrorVector type has +been removed in favor of the (existing) ErrorList +type, and the ErrorVector methods have been migrated. Instead of embedding +an ErrorVector in a client of the scanner, now a client should maintain +an ErrorList. +

+

The set of parse functions provided by the go/parser package has been reduced to the primary parse function @@ -1001,6 +1111,17 @@ convenience functions ParseDirParseExpr.

+

+The go/printer package supports an additional +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 +used to provide comments associated with an arbitrary +ast.Node (until now only +ast.File carried comment information). +

+

The type names of the go/doc package have been streamlined by removing the Doc suffix: PackageDoc @@ -1098,10 +1219,16 @@ The affected items are:

-Also, the Request.RawURL field has been removed; it was a +The Request.RawURL field has been removed; it was a historical artifact.

+

+The Handle and HandleFunc +functions, and the similarly-named methods of ServeMux, +now panic if an attempt is made to register the same pattern twice. +

+

Updating: Running go fix will update the few programs that are affected except for @@ -1138,9 +1265,7 @@ packages. The old image.ColorImage type is still in the image package but has been renamed image.Uniform, -while image.Tiled -has been renamed -image.Repeated. +while image.Tiled has been removed.

@@ -1201,7 +1326,6 @@ This table lists the renamings.


image.ColorImage image.Uniform -image.Tiled image.Repeated

@@ -1226,6 +1350,18 @@ and Running go fix will update almost all code affected by the change.

+

The log/syslog package

+ +

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

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+

The mime package

@@ -1272,7 +1408,27 @@ Code that uses the old methods will fail to compile and must be updated by hand. The semantic change makes it difficult for the fix tool to update automatically.

-

The os.FileInfo type

+

The os package

+ +

The Time function has been removed; callers should use +the Time type from the +time package.

+ +

The Exec function has been removed; callers should use +Exec from the syscall package, where available.

+ +

The ShellExpand function has been renamed to ExpandEnv.

+ +

The NewFile function +now takes a uintptr fd, instead of an int. +The Fd method on files now +also returns a uintptr.

+ +

Updating: Code will fail to compile and must be updated +by hand.

+ +

The os.FileInfo type

Go 1 redefines the os.FileInfo type, @@ -1546,6 +1702,17 @@ Existing code is unaffected, although benchmarks that use println or panic should be updated to use the new methods.

+

The testing/script package

+ +

+The testing/script package has been deleted. It was a dreg. +

+ +

+Updating: +No code is likely to be affected. +

+

The url package

@@ -1614,50 +1781,6 @@ Code that uses the old fields will fail to compile and must be updated by hand. The semantic changes make it difficult for the fix tool to update automatically.

-

The xml package

- -

-In Go 1, the xml package -has been brought closer in design to the other marshaling packages such -as encoding/gob. -

- -

-The old Parser type is renamed -Decoder and has a new -Decode method. An -Encoder type was also -introduced. -

- -

-The functions Marshal -and Unmarshal -work with []byte values now. To work with streams, -use the new Encoder -and Decoder types. -

- -

-When marshaling or unmarshaling values, the format of supported flags in -field tags has changed to be closer to the -json package -(`xml:"name,flag"`). The matching done between field tags, field -names, and the XML attribute and element names is now case-sensitive. -The XMLName field tag, if present, must also match the name -of the XML element being marshaled. -

- -

-Updating: -Running go fix will update most uses of the package except for some calls to -Unmarshal. Special care must be taken with field tags, -since the fix tool will not update them and if not fixed by hand they will -misbehave silently in some cases. For example, the old -"attr" is now written ",attr" while plain -"attr" remains valid but with a different meaning. -

-

The go command

Packaged releases

diff --git a/doc/go1.tmpl b/doc/go1.tmpl index 1ef408813e4..efe43bc3bf7 100644 --- a/doc/go1.tmpl +++ b/doc/go1.tmpl @@ -771,6 +771,40 @@ longer has a Write method. Its presence was a mistake. and must be updated by hand. Such code is almost certainly incorrect.

+

The bufio package

+ +

+In Go 1, bufio.NewReaderSize +and +bufio.NewWriterSize +functions no longer return an error for invalid sizes. +If the argument size is too small or invalid, it is adjusted. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The compress/flate, compress/gzip and compress/zlib packages

+ +

+In Go 1, the NewWriterXxx functions in +compress/flate, +compress/gzip and +compress/zlib +all return (*Writer, error) if they take a compression level, +and *Writer otherwise. Package gzip's +Compressor and Decompressor types have been renamed +to Writer and Reader. Package flate's +WrongValueError type has been removed. +

+ +

+Updating +What little code is affected will be caught by the compiler and must be updated by hand. +

+

The crypto/aes and crypto/des packages

@@ -840,6 +874,63 @@ to be implemented in the future. No changes will be needed.

+

The encoding/binary package

+ +

+In Go 1, the binary.TotalSize function has been replaced by +Size, +which takes an interface{} argument rather than +a reflect.Value. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The encoding/xml package

+ +

+In Go 1, the xml package +has been brought closer in design to the other marshaling packages such +as encoding/gob. +

+ +

+The old Parser type is renamed +Decoder and has a new +Decode method. An +Encoder type was also introducted. +

+ +

+The functions Marshal +and Unmarshal +work with []byte values now. To work with streams, +use the new Encoder +and Decoder types. +

+ +

+When marshaling or unmarshaling values, the format of supported flags in +field tags has changed to be closer to the +json package +(`xml:"name,flag"`). The matching done between field tags, field +names, and the XML attribute and element names is now case-sensitive. +The XMLName field tag, if present, must also match the name +of the XML element being marshaled. +

+ +

+Updating: +Running go fix will update most uses of the package except for some calls to +Unmarshal. Special care must be taken with field tags, +since the fix tool will not update them and if not fixed by hand they will +misbehave silently in some cases. For example, the old +"attr" is now written ",attr" while plain +"attr" remains valid but with a different meaning. +

+

The expvar package

@@ -888,6 +979,15 @@ The Duration flag is new and affects no existing code. Several packages under go have slightly revised APIs.

+

+A concrete Mode type was introduced for configuration mode flags +in the packages +go/scanner, +go/parser, +go/printer, and +go/doc. +

+

The modes AllowIllegalChars and InsertSemis have been removed from the go/scanner package. They were mostly @@ -896,6 +996,16 @@ useful for scanning text other then Go source files. Instead, the for that purpose.

+

+The ErrorHandler provided +to the scanner's Init method is +now simply a function rather than an interface. The ErrorVector type has +been removed in favor of the (existing) ErrorList +type, and the ErrorVector methods have been migrated. Instead of embedding +an ErrorVector in a client of the scanner, now a client should maintain +an ErrorList. +

+

The set of parse functions provided by the go/parser package has been reduced to the primary parse function @@ -904,6 +1014,17 @@ convenience functions ParseDirParseExpr.

+

+The go/printer package supports an additional +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 +used to provide comments associated with an arbitrary +ast.Node (until now only +ast.File carried comment information). +

+

The type names of the go/doc package have been streamlined by removing the Doc suffix: PackageDoc @@ -1001,10 +1122,16 @@ The affected items are:

-Also, the Request.RawURL field has been removed; it was a +The Request.RawURL field has been removed; it was a historical artifact.

+

+The Handle and HandleFunc +functions, and the similarly-named methods of ServeMux, +now panic if an attempt is made to register the same pattern twice. +

+

Updating: Running go fix will update the few programs that are affected except for @@ -1041,9 +1168,7 @@ packages. The old image.ColorImage type is still in the image package but has been renamed image.Uniform, -while image.Tiled -has been renamed -image.Repeated. +while image.Tiled has been removed.

@@ -1104,7 +1229,6 @@ This table lists the renamings.


image.ColorImage image.Uniform -image.Tiled image.Repeated

@@ -1129,6 +1253,18 @@ and Running go fix will update almost all code affected by the change.

+

The log/syslog package

+ +

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

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+

The mime package

@@ -1175,7 +1311,27 @@ Code that uses the old methods will fail to compile and must be updated by hand. The semantic change makes it difficult for the fix tool to update automatically.

-

The os.FileInfo type

+

The os package

+ +

The Time function has been removed; callers should use +the Time type from the +time package.

+ +

The Exec function has been removed; callers should use +Exec from the syscall package, where available.

+ +

The ShellExpand function has been renamed to ExpandEnv.

+ +

The NewFile function +now takes a uintptr fd, instead of an int. +The Fd method on files now +also returns a uintptr.

+ +

Updating: Code will fail to compile and must be updated +by hand.

+ +

The os.FileInfo type

Go 1 redefines the os.FileInfo type, @@ -1436,6 +1592,17 @@ Existing code is unaffected, although benchmarks that use println or panic should be updated to use the new methods.

+

The testing/script package

+ +

+The testing/script package has been deleted. It was a dreg. +

+ +

+Updating: +No code is likely to be affected. +

+

The url package

@@ -1504,50 +1671,6 @@ Code that uses the old fields will fail to compile and must be updated by hand. The semantic changes make it difficult for the fix tool to update automatically.

-

The xml package

- -

-In Go 1, the xml package -has been brought closer in design to the other marshaling packages such -as encoding/gob. -

- -

-The old Parser type is renamed -Decoder and has a new -Decode method. An -Encoder type was also -introduced. -

- -

-The functions Marshal -and Unmarshal -work with []byte values now. To work with streams, -use the new Encoder -and Decoder types. -

- -

-When marshaling or unmarshaling values, the format of supported flags in -field tags has changed to be closer to the -json package -(`xml:"name,flag"`). The matching done between field tags, field -names, and the XML attribute and element names is now case-sensitive. -The XMLName field tag, if present, must also match the name -of the XML element being marshaled. -

- -

-Updating: -Running go fix will update most uses of the package except for some calls to -Unmarshal. Special care must be taken with field tags, -since the fix tool will not update them and if not fixed by hand they will -misbehave silently in some cases. For example, the old -"attr" is now written ",attr" while plain -"attr" remains valid but with a different meaning. -

-

The go command

Packaged releases