Rob Pike [Fri, 10 Feb 2012 03:30:44 +0000 (14:30 +1100)]
unicode: various documentation tweaks
The comment on IsOneOf regarding Latin-1 was an implementation detail:
when the function is called internally, that condition is true. It used to matter,
but now the comment is a dreg. The function works fine if the character is
Latin-1, so we just delete the comment.
Andrew Balholm [Thu, 9 Feb 2012 22:19:22 +0000 (09:19 +1100)]
database/sql: support ErrSkip in Tx.Exec
If the database driver supports the Execer interface but returns
ErrSkip, calling Exec on a transaction was returning the error instead
of using the slow path.
Alex Brainman [Thu, 9 Feb 2012 03:52:01 +0000 (14:52 +1100)]
gobuilder: fix windows builder
Do not rewrite commands if they have .bash extnsion.
Use path/filepath to manipulate file paths everywhere.
Use all.bat on windows, not all.bash.
Use HOMEDRIVE/HOMEPATH to find .gobuildkey on windows.
Rob Pike [Thu, 9 Feb 2012 03:12:18 +0000 (14:12 +1100)]
cmd/go: rearrange help for 'go test'
Put the 'go test' flags into 'go help test', so 'go help testflags'
is about the flags for the compiled test binary.
Russ Cox [Wed, 8 Feb 2012 20:24:48 +0000 (15:24 -0500)]
spec: send on closed channel counts as "proceeding"
Other wordings are possible but defining this as one
of the ways to proceed means we don't have to add
language about this to the description of select.
Fixes #2825.
R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5643062
Robert Griesemer [Wed, 8 Feb 2012 19:41:32 +0000 (11:41 -0800)]
go/scanner: clean up error interface
Issue 2856 asks for a rename of a few methods to a
more idiomatic Go style. This is a very early API
that evolved organically throughout the years.
Together with the fact that ErrorVectors were embedded
in other data structures (e.g. Parser), just renaming
methods (e.g. GetError -> Error) would lead to undesired
behavior (e.g., Parser would act like an Error). Instead,
cleaned up API a bit more:
- removed ErrorVector in favor of ErrorList (already
present)
- simplified Scanner.Init by making the error handler a
function instead of requiring an ErrorHandler implementation
- adjusted helper functions accordingly
- updated Go 1 doc
Paul Borman [Wed, 8 Feb 2012 19:39:16 +0000 (14:39 -0500)]
runtime: drop to 32 bit malloc if 64 bit will not work
On 64 bit UML it is not possible to reserve memory at 0xF8<<32.
Detect when linux cannot use these high virtual memory addresses
and drop back to the 32 bit memory allocator.
Russ Cox [Wed, 8 Feb 2012 15:33:54 +0000 (10:33 -0500)]
runtime, pprof: add profiling of thread creation
Same idea as heap profile: how did each thread get created?
Low memory (256 bytes per OS thread), high reward for
programs that suddenly have many threads running.
Jamie Gennis [Wed, 8 Feb 2012 15:25:13 +0000 (10:25 -0500)]
6g,8g: make constant propagation inlining-friendly.
This changes makes constant propagation compare 'from' values using node
pointers rather than symbol names when checking to see whether a set
operation is redundant. When a function is inlined multiple times in a
calling function its arguments will share symbol names even though the values
are different. Prior to this fix the bug409 test would hit a case with 6g
where an LEAQ instruction was incorrectly eliminated from the second inlined
function call. 8g appears to have had the same bug, but the test did not fail
there.
Andrew Pritchard [Wed, 8 Feb 2012 06:14:15 +0000 (17:14 +1100)]
database/sql: treat pointers as nullable types like encoding/json
- convert from nil pointers to the nil interface{}
- dereference non-nil pointers
- convert from nil interface{}s to nil pointers
- allocate pointers for non-nil interface{}s
- tests for all of the above
Russ Cox [Wed, 8 Feb 2012 04:37:25 +0000 (23:37 -0500)]
time: clean up MarshalJSON, add RFC3339 method
encoding/xml: handle time.Time as recognized type
The long term plan is to define an interface that time.Time
can implement and that encoding/xml can call, but we are
not going to try to define that interface before Go 1.
Instead, special-case time.Time in package xml, because
it is such a fundamental type, as a stop-gap.
The eventual methods will behave this way.
Gustavo Niemeyer [Wed, 8 Feb 2012 03:57:44 +0000 (01:57 -0200)]
encoding/xml: add support for the omitempty flag
This also changes the behavior of attribute marshalling so
that strings and byte slices are marshalled even if empty.
The omitempty flag may be used to obtain the previous behavior.
Rob Pike [Wed, 8 Feb 2012 03:09:20 +0000 (14:09 +1100)]
encoding/binary: hide TotalSize
The function has a bizarre signature: it was the only public function there
that exposed the reflect package. Also, its definition is peculiar and hard to
explain. It doesn't merit being exported.
This is an API change but really, it should never have been exported and
it's certain very few programs will depend on it: it's too weird.
Rob Pike [Wed, 8 Feb 2012 02:07:13 +0000 (13:07 +1100)]
bufio: drop error return for NewReaderSize and NewWriterSize
It complicates the interface unnecessarily.
Document this in go1.html.
Also update the go/doc Makefile.
Robert Griesemer [Tue, 7 Feb 2012 23:19:52 +0000 (15:19 -0800)]
go/printer, gofmt: don't print incorrect programs
Be careful when printing line comments with incorrect
position information. Maintain additional state
impliedSemi: when set, a comment containing a newline
would imply a semicolon and thus placement must be
delayed.
Precompute state information pertaining to the next
comment for faster checks (the printer is marginally
faster now despite additional checks for each comment).
Rob Pike [Tue, 7 Feb 2012 05:15:55 +0000 (16:15 +1100)]
encoding/gob: document CommonType
Also bring the names in doc.go in line with the source.
More radical resolutions are possible but require substantial internal
changes for very little benefit. Fixing it this way lets us keep the
embedding, which has a huge simplifying effect, and guarantees
binary compatibility.