2012-09-24 18:57:01 -06:00
<!-- {
"Title": "Go 1.1 Release Notes",
2012-09-26 09:49:36 -06:00
"Path": "/doc/go1.1",
2012-09-24 18:57:01 -06:00
"Template": true
}-->
< h2 id = "introduction" > Introduction to Go 1.1< / h2 >
TODO
- overview
- link back to Go 1 and also Go 1 Compatibility docs.
2013-03-18 16:27:05 -06:00
- links through body of text
2012-09-24 18:57:01 -06:00
< h2 id = "language" > Changes to the language< / h2 >
TODO
2013-01-30 10:23:36 -07:00
< h3 id = "divzero" > Integer division by zero< / h3 >
< p >
In Go 1, integer division by a constant zero produced a runtime panic:
< / p >
< pre >
func f(x int) int {
return x/0
}
< / pre >
< p >
In Go 1.1, an integer division by constant zero is not a legal program, so it is a compile-time error.
< / p >
2012-09-24 18:57:01 -06:00
< h2 id = "impl" > Changes to the implementations and tools< / h2 >
2013-03-18 23:50:32 -06:00
< p >
TODO: more
< / p >
2012-09-24 18:57:01 -06:00
cmd/5l, cmd/6l, cmd/8l, cmd/cc, cmd/gc: new flag parsing
This CL adds a flag parser that matches the semantics of Go's
package flag. It also changes the linkers and compilers to use
the new flag parser.
Command lines that used to work, like
8c -FVw
6c -Dfoo
5g -I/foo/bar
now need to be split into separate arguments:
8c -F -V -w
6c -D foo
5g -I /foo/bar
The new spacing will work with both old and new tools.
The new parser also allows = for arguments, as in
6c -D=foo
5g -I=/foo/bar
but that syntax will not work with the old tools.
In addition to matching standard Go binary flag parsing,
the new flag parser generates more detailed usage messages
and opens the door to long flag names.
The recently added gc flag -= has been renamed -complete.
R=remyoudompheng, daniel.morsing, minux.ma, iant
CC=golang-dev
https://golang.org/cl/7035043
2013-01-06 13:24:47 -07:00
< h3 id = "gc-flag" > Command-line flag parsing< / h3 >
< p >
2013-03-18 23:50:32 -06:00
In the gc tool chain, the compilers and linkers now use the
cmd/5l, cmd/6l, cmd/8l, cmd/cc, cmd/gc: new flag parsing
This CL adds a flag parser that matches the semantics of Go's
package flag. It also changes the linkers and compilers to use
the new flag parser.
Command lines that used to work, like
8c -FVw
6c -Dfoo
5g -I/foo/bar
now need to be split into separate arguments:
8c -F -V -w
6c -D foo
5g -I /foo/bar
The new spacing will work with both old and new tools.
The new parser also allows = for arguments, as in
6c -D=foo
5g -I=/foo/bar
but that syntax will not work with the old tools.
In addition to matching standard Go binary flag parsing,
the new flag parser generates more detailed usage messages
and opens the door to long flag names.
The recently added gc flag -= has been renamed -complete.
R=remyoudompheng, daniel.morsing, minux.ma, iant
CC=golang-dev
https://golang.org/cl/7035043
2013-01-06 13:24:47 -07:00
same command-line flag parsing rules as the Go flag package, a departure
from the traditional Unix flag parsing. This may affect scripts that invoke
the tool directly.
For example,
< code > go tool 6c -Fw -Dfoo< / code > must now be written
< code > go tool 6c -F -w -D foo< / code > .
< / p >
2012-09-24 18:57:01 -06:00
< h3 id = "int" > Size of int on 64-bit platforms< / h3 >
< p >
The language allows the implementation to choose whether the < code > int< / code > type and < code > uint< / code > types are 32 or 64 bits. Previous Go implementations made < code > int< / code > and < code > uint< / code > 32 bits on all systems. Both the gc and gccgo implementations (TODO: check that gccgo does) < a href = "http://golang.org/issue/2188" > now make < code > int< / code > and < code > uint< / code > 64 bits on 64-bit platforms such as AMD64/x86-64< / a > .
Among other things, this enables the allocation of slices with
more than 2 billion elements on 64-bit platforms.
< / p >
< p >
< em > Updating< / em > :
Most programs will be unaffected by this change.
Because Go does not allow implicit conversions between distinct
2013-03-18 16:27:05 -06:00
< a href = "/ref/spec/#Numeric_types" > numeric types< / a > ,
2012-09-24 18:57:01 -06:00
no programs will stop compiling due to this change.
However, programs that contain implicit assumptions
that < code > int< / code > is only 32 bits may change behavior.
For example, this code prints a positive number on 64-bit systems and
a negative one on 32-bit systems:
< pre >
x := ^uint32(0) // x is 0xffffffff
i := int(x) // i is -1 on 32-bit systems, 0xffffffff on 64-bit
fmt.Println(i)
< / pre >
< p > Portable code intending 32-bit sign extension (yielding -1 on all systems)
would instead say:
< / p >
< pre >
i := int(int32(x))
< / pre >
2013-03-18 23:50:32 -06:00
< h3 id = "unicode_surrogates" > Unicode< / h3 >
< p >
To make it possible to represent code points greater than 65535 in UTF-16,
Unicode defines < em > surrogate halves< / em > ,
a range of code points to be used only in the assembly of large values, and only in UTF-16.
The code points in that surrogate range are illegal for any other purpose.
In Go 1.1, this constraint is honored by the compiler, libraries, and run-time:
a surrogate half is illegal as a rune value, when encoded as UTF-8, or when
encoded in isolation as UTF-16.
When encountered, for example in converting from a rune to UTF-8, it is
treated as an encoding error and will yield the replacement rune,
< a href = "/pkg/unicode/utf8/#RuneError" > < code > utf8.RuneError< / code > < / a > ,
U+FFFD.
< / p >
< p >
This program,
< / p >
< pre >
import "fmt"
func main() {
fmt.Printf("%+q\n", string(0xD800))
}
< / pre >
< p >
printed < code > "\ud800"< / code > in Go 1.0, but prints < code > "\ufffd"< / code > in Go 1.1.
< / p >
< p >
The Unicode byte order marks U+FFFE and U+FEFF, encoded in UTF-8, are now permitted as the first
character of a Go source file.
Even though their appearance in the byte-order-free UTF-8 encoding is clearly unnecessary,
some editors add them as a kind of "magic number" identifying a UTF-8 encoded file.
< / p >
< p >
< em > Updating< / em > :
Most programs will be unaffected by the surrogate change.
Programs that depend on the old behavior should be modified to avoid the issue.
The byte-order-mark change is strictly backwards- compatible.
< / p >
2012-09-24 18:57:01 -06:00
< h3 id = "asm" > Assembler< / h3 >
< p >
Due to the < a href = "#int" > int< / a > and TODO: OTHER changes,
the placement of function arguments on the stack has changed.
Functions written in assembly will need to be revised at least
to adjust frame pointer offsets.
< / p >
2013-01-09 15:57:01 -07:00
< h3 id = "gotool" > Changes to the go tool< / h3 >
2013-01-02 05:38:47 -07:00
2013-01-09 15:57:01 -07:00
< p > The < code > go< / code > tool has acquired several improvements which are intended to improve the experience for new Go users.< / p >
< p > Firstly, when compiling, testing, or running Go code, the < code > go< / code > tool will now give more detailed errors messages, including a list of paths searched, when a package cannot be located.
2013-01-02 05:38:47 -07:00
< / p >
2013-01-09 15:57:01 -07:00
< pre >
$ go build foo/quxx
can't load package: package foo/quxx: cannot find package "foo/quxx" in any of:
/home/User/go/src/pkg/foo/quxx (from $GOROOT)
/home/User/src/foo/quxx (from $GOPATH)
< / pre >
cmd/ld: use native-endian symbol values in symbol table
The Plan 9 symbol table format defines big-endian symbol values
for portability, but we want to be able to generate an ELF object file
and let the host linker link it, as part of the solution to issue 4069.
The symbol table itself, since it is loaded into memory at run time,
must be filled in by the final host linker, using relocation directives
to set the symbol values. On a little-endian machine, the linker will
only fill in little-endian values during relocation, so we are forced
to use little-endian symbol values.
To preserve most of the original portability of the symbol table
format, we make the table itself say whether it uses big- or
little-endian values. If the table begins with the magic sequence
fe ff ff ff 00 00
then the actual table begins after those six bytes and contains
little-endian symbol values. Otherwise, the table is in the original
format and contains big-endian symbol values. The magic sequence
looks like an "end of table" entry (the fifth byte is zero), so legacy
readers will see a little-endian table as an empty table.
All the gc architectures are little-endian today, so the practical
effect of this CL is to make all the generated tables little-endian,
but if a big-endian system comes along, ld will not generate
the magic sequence, and the various readers will fall back to the
original big-endian interpretation.
R=ken2
CC=golang-dev
https://golang.org/cl/7066043
2013-01-04 15:03:57 -07:00
< p >
2013-01-09 15:57:01 -07:00
Secondly, the < code > go get< / code > command no longer allows < code > $GOROOT< / code > as the default destination when downloading package source. To use < code > go get< / code > command, a valid < code > $GOPATH< / code > is now required.
< / p >
< pre >
$ GOPATH= go get code.google.com/p/foo/quxx
package code.google.com/p/foo/quxx: cannot download, $GOPATH not set. For more details see: go help gopath
< / pre >
< p > Finally, as a result of the previous change, the < code > go get< / code > command will also fail when < code > $GOPATH< / code > and < code > $GOROOT< / code > are set to the same value.
cmd/ld: use native-endian symbol values in symbol table
The Plan 9 symbol table format defines big-endian symbol values
for portability, but we want to be able to generate an ELF object file
and let the host linker link it, as part of the solution to issue 4069.
The symbol table itself, since it is loaded into memory at run time,
must be filled in by the final host linker, using relocation directives
to set the symbol values. On a little-endian machine, the linker will
only fill in little-endian values during relocation, so we are forced
to use little-endian symbol values.
To preserve most of the original portability of the symbol table
format, we make the table itself say whether it uses big- or
little-endian values. If the table begins with the magic sequence
fe ff ff ff 00 00
then the actual table begins after those six bytes and contains
little-endian symbol values. Otherwise, the table is in the original
format and contains big-endian symbol values. The magic sequence
looks like an "end of table" entry (the fifth byte is zero), so legacy
readers will see a little-endian table as an empty table.
All the gc architectures are little-endian today, so the practical
effect of this CL is to make all the generated tables little-endian,
but if a big-endian system comes along, ld will not generate
the magic sequence, and the various readers will fall back to the
original big-endian interpretation.
R=ken2
CC=golang-dev
https://golang.org/cl/7066043
2013-01-04 15:03:57 -07:00
< / p >
2013-01-09 15:57:01 -07:00
< pre >
$ GOPATH=$GOROOT go get code.google.com/p/foo/quxx
warning: GOPATH set to GOROOT (/home/User/go) has no effect
package code.google.com/p/foo/quxx: cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath
< / pre >
2013-02-21 12:28:34 -07:00
< h3 id = "gofix" > Changes to go fix< / h3 >
< p >
The < code > go fix< / code > command no longer applies fixes to update code from
2013-03-18 23:50:32 -06:00
before Go 1 to use Go 1 APIs. To update pre-Go 1 code to Go 1.1, use a Go 1.0 tool chain
2013-02-21 12:28:34 -07:00
to convert the code to Go 1.0 first.
< / p >
2013-03-18 16:27:05 -06:00
< h2 id = "performance" > Performance< / h2 >
< p >
TODO introduction
< / p >
< ul >
< li > TODO better code generation (inlining, ...?)< / li >
< li > TODO parallel gc< / li >
< li > TODO more precise gc< / li >
< li > TODO networking is more efficient (known to runtime)< / li >
< / ul >
2012-09-24 18:57:01 -06:00
< h2 id = "library" > Changes to the standard library< / h2 >
2013-03-18 16:27:05 -06:00
< h3 id = "bufio_scanner" > bufio.Scanner< / h3 >
< p >
TODO
< / p >
2013-02-28 14:32:36 -07:00
< h3 id = "debug_elf" > debug/elf< / h3 >
2012-11-14 08:24:14 -07:00
< p >
Previous versions of the debug/elf package intentionally skipped over the first
symbol in the ELF symbol table, since it is always an empty symbol. This symbol
is no longer skipped since indexes into the symbol table returned by debug/elf,
will be different to indexes into the original ELF symbol table. Any code that
calls the debug/elf functions Symbols or ImportedSymbols may need to be
adjusted to account for the additional symbol and the change in symbol offsets.
< / p >
2012-12-10 16:08:07 -07:00
< h3 id = "net" > net< / h3 >
< p >
The protocol-specific resolvers were formerly
lax about the network name passed in. For example, although the documentation was clear
that the only valid networks for < code > ResolveTCPAddr< / code > are < code > "tcp"< / code > ,
< code > "tcp4"< / code > , and < code > "tcp6"< / code > , the Go 1.0 implementation silently accepted
any string. The Go 1.1 implementation returns an error if the network is not one of those strings.
The same is true of the other protocol-specific resolvers < code > ResolveIPAddr< / code > , < code > ResolveUDPAddr< / code > , and
< code > ResolveUnixAddr< / code > .
< / p >
2012-12-15 19:51:47 -07:00
< p >
The previous < code > ListenUnixgram< / code > returned < code > UDPConn< / code > as
2013-03-18 23:50:32 -06:00
a representation of the connection endpoint. The Go 1.1 implementation
2012-12-15 19:51:47 -07:00
returns < code > UnixConn< / code > to allow reading and writing
with < code > ReadFrom< / code > and < code > WriteTo< / code > methods on
the < code > UnixConn< / code > .
< / p >
2012-12-10 16:08:07 -07:00
2013-03-18 16:27:05 -06:00
< h3 id = "reflect" > reflect< / h3 >
< p >
TODO:
< code > reflect< / code > : Select, ChanOf, MakeFunc, MapOf, SliceOf, Convert, Type.ConvertibleTo
< / p >
< h3 id = "runtime" > runtime< / h3 >
< p >
TODO:
< code > runtime< / code > : BlockProfile
< / p >
2012-12-09 01:59:33 -07:00
< h3 id = "time" > time< / h3 >
< p >
runtime: use clock_gettime to get ns resolution for time.now & runtime.nanotime
For Linux/{386,arm}, FreeBSD/{386,amd64,arm}, NetBSD/{386,amd64}, OpenBSD/{386,amd64}.
Note: our Darwin implementation already has ns resolution.
Linux/386 (Core i7-2600 @ 3.40GHz, kernel 3.5.2-gentoo)
benchmark old ns/op new ns/op delta
BenchmarkNow 110 118 +7.27%
Linux/ARM (ARM Cortex-A8 @ 800MHz, kernel 2.6.32.28 android)
benchmark old ns/op new ns/op delta
BenchmarkNow 625 542 -13.28%
Linux/ARM (ARM Cortex-A9 @ 1GHz, Pandaboard)
benchmark old ns/op new ns/op delta
BenchmarkNow 992 909 -8.37%
FreeBSD 9-REL-p1/amd64 (Dell R610 Server with Xeon X5650 @ 2.67GHz)
benchmark old ns/op new ns/op delta
BenchmarkNow 699 695 -0.57%
FreeBSD 9-REL-p1/amd64 (Atom D525 @ 1.80GHz)
benchmark old ns/op new ns/op delta
BenchmarkNow 1553 1658 +6.76%
OpenBSD/amd64 (Dell E6410 with i5 CPU M 540 @ 2.53GHz)
benchmark old ns/op new ns/op delta
BenchmarkNow 1262 1236 -2.06%
OpenBSD/i386 (Asus eeePC 701 with Intel Celeron M 900MHz - locked to 631MHz)
benchmark old ns/op new ns/op delta
BenchmarkNow 5089 5043 -0.90%
NetBSD/i386 (VMware VM with Core i5 CPU @ 2.7GHz)
benchmark old ns/op new ns/op delta
BenchmarkNow 277 278 +0.36%
NetBSD/amd64 (VMware VM with Core i5 CPU @ 2.7Ghz)
benchmark old ns/op new ns/op delta
BenchmarkNow 103 105 +1.94%
Thanks Maxim Khitrov, Joel Sing, and Dave Cheney for providing benchmark data.
R=jsing, dave, rsc
CC=golang-dev
https://golang.org/cl/6820120
2012-12-18 07:57:25 -07:00
On FreeBSD, Linux, NetBSD, OS X and OpenBSD, previous versions of the time package
returned times with microsecond precision. The Go 1.1 implementation of time on these
systems now returns times with nanosecond precision. Code may exist that expects to be
able to store such a time in an external format with only microsecond precision,
2012-12-09 01:59:33 -07:00
read it back, and recover exactly the same time instant.
In Go 1.1 the same time will not be recovered, since the external storage
will have discarded nanoseconds.
To address this case, there are two new methods of time.Time, Round and Truncate,
that can be used to remove precision from a time before passing it to
external storage.
< / p >
2013-03-18 16:27:05 -06:00
< p > TODO:
< code > time< / code > : ParseInLocation, Timer.Reset, Time.YearDay
< / p >
2013-03-02 12:55:25 -07:00
< h3 id = "exp_old" > Exp and old subtrees moved to go.exp subrepo< / h3 >
< p >
To make it easier for binary distributions to access them if desired, the < code > exp< / code >
and < code > old< / code > source subtrees, which are not included in binary distributions,
have been moved to the new < code > go.exp< / code > subrepository at
< code > code.google.com/p/go.exp< / code > . To access the < code > ssa< / code > package,
for example, run
< / p >
< pre >
2013-03-03 10:12:36 -07:00
$ go get code.google.com/p/go.exp/ssa
2013-03-02 12:55:25 -07:00
< / pre >
< p >
and then in Go source,
< / p >
< pre >
2013-03-03 10:12:36 -07:00
import "code.google.com/p/go.exp/ssa"
2013-03-02 12:55:25 -07:00
< / pre >
2013-03-18 16:27:05 -06:00
< h3 id = "minor_library_changes" > Minor changes to the library< / h3 >
< p >
The following list summarizes a number of minor changes to the library, mostly additions.
See the relevant package documentation for more information about each change.
< / p >
< ul >
< li >
The < a href = "/pkg/bytes/" > < code > bytes< / code > < / a > package has two new functions,
< a href = "/pkg/bytes/#TrimPrefix" > < code > TrimPrefix< / code > < / a >
and
< a href = "/pkg/bytes/#TrimSuffix" > < code > TrimSuffix< / code > < / a > ,
with self-evident properties.
Also, the < a href = "/pkg/bytes/#Buffer" > < code > Buffer< / code > < / a > type
has a new method
< a href = "/pkg/bytes/#Buffer.Grow" > < code > Grow< / code > < / a > that
provides some control over memory allocation inside the buffer.
Finally, the
< a href = "/pkg/bytes/#Reader" > < code > Reader< / code > < / a > type now has a
< a href = "/pkg/strings/#Reader.WriteTo" > < code > WriteTo< / code > < / a > method
so it implements the
< a href = "/pkg/io/#WriterTo" > < code > io.WriterTo< / code > < / a > interface.
< / li >
< li >
The < a href = "/pkg/crypto/hmac/" > < code > crypto/hmac< / code > < / a > package has a new function,
< a href = "/pkg/crypto/hmac/#Equal" > < code > Equal< / code > < / a > , to compare two MACs.
< / li >
< li > TODO:
< code > crypto/x509< / code > : DecryptPEMBlock, EncryptPEMBlock etc.
< / li >
< li > TODO:
< code > database/sql/driver< / code > : Queryer
< / li >
< li > TODO:
< code > database/sql< / code > : Ping, SetMaxIdleConns
< / li >
< li > TODO:
< code > encoding/json< / code > : Decoder.Buffered, UseNumber, Number
< / li >
< li > TODO:
< code > encoding/xml< / code > : EscapeText Encoder.Indent
< / li >
< li >
In the < a href = "/pkg/go/ast/" > < code > go/ast< / code > < / a > package, a
new type < a href = "/pkg/go/ast/#CommentMap" > < code > CommentMap< / code > < / a >
and associated methods makes it easier to extract and process comments in Go programs.
< / li >
< li >
In the < a href = "/pkg/go/doc/" > < code > go/doc< / code > < / a > package,
the parser now keeps better track of stylized annotations such as < code > TODO(joe)< / code >
throughout the code,
information that the < a href = "/cmd/godoc/" > < code > godoc< / code > < / a >
command can filter or present according to the value of the < code > -notes< / code > flag.
< / li >
< li > TODO:
< code > go/format< / code > : Node, Source
< / li >
< li >
The undocumented and only partially implemented "noescape" feature of the
< a href = "/pkg/html/template/" > html/template< / a >
package has been removed; programs that depend on it will break.
< / li >
< li >
The < a href = "/pkg/io/" > io< / a > package now exports the
< a href = "/pkg/io/#ByteWriter" > < code > io.ByteWriter< / code > < / a > interface to capture the common
functionality of writing a byte at a time.
< / li >
< li >
The < a href = "/pkg/log/syslog/" > < code > log/syslog< / code > < / a > package now provides better support
for OS-specific logging features.
< / li >
< li >
The < a href = "/pkg/math/big/" > < code > math/big< / code > < / a > package's
< a href = "/pkg/math/big/#Int" > < code > Int< / code > < / a > type now has
now has methods
< a href = "/pkg/math/big/#Int.MarshalJSON" > < code > MarshalJSON< / code > < / a >
and
< a href = "/pkg/math/big/#Int.UnmarshalJSON" > < code > UnmarshalJSON< / code > < / a >
to convert to and from a JSON representation.
Also,
< a href = "/pkg/math/big/#Int" > < code > Int< / code > < / a >
can now convert directly to and from a < code > uint64< / code > using
< a href = "/pkg/math/big/#Int.Uint64" > < code > Uint64< / code > < / a >
and
< a href = "/pkg/math/big/#Int.SetUint64" > < code > SetUint64< / code > < / a > ,
while
< a href = "/pkg/math/big/#Rat" > < code > Rat< / code > < / a >
can do the same with < code > float64< / code > using
< a href = "/pkg/math/big/#Rat.Float64" > < code > Float64< / code > < / a >
and
< a href = "/pkg/math/big/#Rat.SetFloat64" > < code > SetFloat64< / code > < / a > .
< / li >
< li > TODO:
< code > mime/multipart< / code > : Writer.SetBoundary
< / li >
< li >
The new < a href = "/pkg/net/http/cookiejar/" > net/http/cookiejar< / a > package provides the basics for managing HTTP cookies.
< / li >
< li > TODO:
< code > net/http< / code > : ParseTime, CloseNotifier, Request.PostFormValue, ServeMux.Handler, Transport.CancelRequest
< / li >
< li > TODO:
< code > net/mail< / code > : ParseAddress, ParseAddressList
< / li >
< li > TODO:
< code > net/smtp< / code > : Client.Hello
< / li >
< li > TODO:
< code > net/textproto< / code > : TrimBytes, TrimString
< / li >
< li >
< code > net< / code > : DialOption, DialOpt, ListenUnixgram, LookupNS, IPConn.ReadMsgIP, IPConn.WriteMsgIP, UDPConn.ReadMsgUDP, UDPConn.WriteMsgUDP, UnixConn.CloseRead, UnixConn.CloseWrite
< / li >
< li >
The new method < a href = "/pkg/os/#FileMode.IsRegular" > < code > os.FileMode.IsRegular< / code > < / a > makes it easy to ask if a file is a plain file.
< / li >
< li > TODO:
< code > pkg/image< / code > : new subsamplings
< / li >
< li >
The < a href = "/pkg/regexp/" > < code > regexp< / code > < / a > package
2013-03-18 23:50:32 -06:00
now supports Unix-original leftmost-longest matches through the
2013-03-18 16:27:05 -06:00
< a href = "/pkg/regexp/#Regexp.Longest" > < code > Regexp.Longest< / code > < / a >
method, while
< a href = "/pkg/regexp/#Regexp.Split" > < code > Regexp.Split< / code > < / a > slices
strings into pieces based on separators defined by the regular expression.
< / li >
< li > TODO:
< code > runtime/debug< / code > : FreeOSMemory, ReadGCStats, SetGCPercent
< / li >
< li >
The < a href = "/pkg/sort/" > < code > sort< / code > < / a > package has a new function,
< a href = "/pkg/sort/#Reverse" > < code > Reverse< / code > < / a > .
Wrapping the argument of a call to
< a href = "/pkg/sort/#Sort" > < code > sort.Sort< / code > < / a >
with a call to < code > Reverse< / code > causes the sort order to be reversed.
< / li >
< li >
The < a href = "/pkg/strings/" > < code > strings< / code > < / a > package has two new functions,
< a href = "/pkg/strings/#TrimPrefix" > < code > TrimPrefix< / code > < / a >
and
< a href = "/pkg/strings/#TrimSuffix" > < code > TrimSuffix< / code > < / a >
with self-evident properties, and the the new method
< a href = "/pkg/strings/#Reader.WriteTo" > < code > Reader.WriteTo< / code > < / a > so the
< a href = "/pkg/strings/#Reader" > < code > Reader< / code > < / a >
type now implements the
< a href = "/pkg/io/#WriterTo" > < code > io.WriterTo< / code > < / a > interface.
< / li >
< li >
The < a href = "/pkg/syscall/" > < code > syscall< / code > < / a > package has received many updates to make it more inclusive of constants and system calls for each supported operating system.
< / li >
< li >
The < a href = "/pkg/testing/" > < code > testing< / code > < / a > package now automates the generation of allocation
statistics in benchmarks using the new
< a href = "/pkg/testing/#AllocsPerRun" > < code > AllocsPerRun< / code > < / a > function and the
< a href = "/pkg/testing/#BenchmarkResult.AllocsPerOp" > < code > AllocsPerOp< / code > < / a > method of
< a href = "/pkg/testing/#BenchmarkResult" > < code > BenchmarkResult< / code > < / a > .
There is also a new
< a href = "/pkg/testing/#Verbose" > < code > Verbose< / code > < / a > function to test the state of the < code > -v< / code >
command-line flag,
and a new
< a href = "/pkg/testing/#B.Skip" > < code > Skip< / code > < / a > method of
< a href = "/pkg/testing/#B" > < code > testing.B< / code > < / a > and
< a href = "/pkg/testing/#T" > < code > testing.T< / code > < / a >
to simplify skipping an inappropriate test.
< / li >
< li >
In the < a href = "/pkg/text/template/" > < code > text/template< / code > < / a >
and
< a href = "/pkg/html/template/" > < code > html/template< / code > < / a > packages,
templates can now use parentheses to group the elements of pipelines, simplifying the construction of complex pipelines.
TODO: Link to example.
< / li >
< li >
In the < a href = "/pkg/unicode/utf8/" > < code > unicode/utf8< / code > < / a > package,
the new function < a href = "/pkg/unicode/utf8/#ValidRune" > < code > ValidRune< / code > < / a > reports whether the rune is a valid Unicode code point.
To be valid, a rune must be in range and not be a surrogate half.
< / li >
< li >
The implementation of the < a href = "/pkg/unicode/" > < code > unicode< / code > < / a > package has been updated to Unicode version 6.2.0.
< / li >
< / ul >