Gustavo Niemeyer [Tue, 25 Jan 2011 01:36:13 +0000 (11:36 +1000)]
misc: Import/Drop commands for Vim
New ftplugin adds Import and Drop commands for Go buffers
in Vim. These commands ensure that the provided package is
imported (or not imported) in the current Go buffer, using
proper style and ordering, without moving the cursor.
E.g.
:Import strings
:ImportAs . strings
:Drop strings
Two mappings are also introduced to help with the fmt package:
Hector Chu [Mon, 24 Jan 2011 19:16:24 +0000 (14:16 -0500)]
codereview: fix windows
Uploading go files on Windows aborts with gofmt: exceptions.ValueError:
close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr
R=rsc, mattn, Joe Poirier
CC=golang-dev
https://golang.org/cl/4025046
Rob Pike [Sat, 22 Jan 2011 00:10:39 +0000 (16:10 -0800)]
gob: fix the grammar comments to match the encoder
(or at least a correct encoder, still to come).
Change the debug structure slightly to better represent
the grammar.
Minor tweaks for consistency in type.go.
Ian Lance Taylor [Fri, 21 Jan 2011 21:57:52 +0000 (13:57 -0800)]
net: Fix race condition in test.
The test code used to do this:
for _, tc := range tests {
ch <- &tc
}
Note that &tc is always the same value here. As the value is
received from the channel, the sender can loop around and
change the contents of tc. This means that the receiver's
value is unstable and can change while it is in use.
Rob Pike [Fri, 21 Jan 2011 19:28:53 +0000 (11:28 -0800)]
gob: better debugging, commentary
Re-implement the debugging helper to be independent of the existing
implementation. This is preparatory to a rewrite to clean up issue 1416.
Include a definition of the grammar of the data stream.
Anschel Schaffer-Cohen [Fri, 21 Jan 2011 03:58:08 +0000 (19:58 -0800)]
Fixed documentation for netchan import()
This was broken after the last update (2011-01-20).
However, I'm not sure if the changed example is a
sensible use of import(), so I'd appreciate comments.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4067043
Russ Cox [Thu, 20 Jan 2011 14:20:47 +0000 (09:20 -0500)]
runtime: make select fairer
The o+i*p approach to visiting select cases in random
order stops being fair when there is some case that
is never ready. If that happens, then the case that follows
it in the order gets more chances than the others.
In general the only way to ensure fairness is to make
all permutations equally likely. I've done that by computing
one explicitly.
Makes the permutations correct for n >= 4 where
previously they were broken. For n > 12, there's not
enough randomness to do a perfect job but this should
still be much better than before.
Robert Griesemer [Thu, 20 Jan 2011 04:07:21 +0000 (23:07 -0500)]
go spec: remove float, complex in favor of float64 and complex128
The default float type is not very useful but for the most basic applications.
For instance, as it is now, using the math package requires conversions for float
variables (the arguments for math functions are usually float64). Typical real
applications tend to specify the floating point precision required.
This proposal removes the predeclared types float and complex. Variable declarations
without type specification but with constant floating point or complex initializer
expressions will assume the type float64 or complex128 respectively.
The predeclared function cmplx is renamed to complex.
Robert Griesemer [Wed, 19 Jan 2011 22:33:05 +0000 (14:33 -0800)]
godoc: enable fulltext index by default
- added flag -maxresults (default: 10000) to limit the max.
number of full text results shown
- removed flag -fulltext; use -maxresults=0 to disable fulltext
index
- better indication on result page if not all results are shown
(... after line list)
Robert Griesemer [Wed, 19 Jan 2011 20:48:10 +0000 (12:48 -0800)]
godoc: enable qualified identifiers ("math.Sin") as query strings again
A query string of the form ident.ident will be used both as a qualified
identifier for identifier search and as a regular expression.
Qualified identifier lookup got broken accidentally when introducing
regexp full text search. Cleaned up surrounding logic a bit.
Gustavo Niemeyer [Wed, 19 Jan 2011 20:43:58 +0000 (15:43 -0500)]
xml: handle tag paths through the same element
With the current implementation, xml unmarshalling
will silently fail to unmarshal any paths passing
through the same element, such as:
type T struct {
A string "dummy>a"
B string "dummy>b"
}
This change tweaks the algorithm so that this works
correctly.
Also, using paths that would cause the same element to
unmarshal twice will error out ahead of time explaining
the problem, rather than silently misbehaving.
Roger Peppe [Wed, 19 Jan 2011 20:28:49 +0000 (12:28 -0800)]
netchan: do not block sends; implement flow control.
When data is received for a channel, but that channel
is not ready to receive it, the central run() loop
is currently blocked, but this can lead to deadlock
and interference between independent channels.
This CL adds an explicit buffer size to netchan
channels (an API change) - the sender will not
send values until the buffer is non empty.
The protocol changes to send ids rather than channel names
because acks can still be sent after a channel is hung up,
we we need an identifier that can be ignored.
Eoghan Sherry [Wed, 19 Jan 2011 19:23:59 +0000 (14:23 -0500)]
math: handle denormals in Frexp, Ilogb, Ldexp, and Logb
Also:
* document special cases for Frexp and Ldexp
* handle ±Inf in Ldexp
* correctly return -0 on underflow in Ldexp
* test special cases for Ldexp
* test boundary cases for Frexp, Ilogb, Ldexp, and Logb
Ben Lynn [Wed, 19 Jan 2011 18:47:04 +0000 (13:47 -0500)]
regexp: reject bare ?
Minor cleanup:
- removed a duplicate test case
- added a function to remove repeated code
- for consistency, replaced "return nil" with a panic at an
unreachable point
Yasuhiro Matsumoto [Wed, 19 Jan 2011 07:00:19 +0000 (23:00 -0800)]
syscall: fix build. WUNTRACED isn't defined for win32.
For Windows, the options for syscall.Wait4() aren't used.
Then this will be dummy value like WNOHANG, WSTOPPED.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4075041
Gustavo Niemeyer [Tue, 18 Jan 2011 20:39:38 +0000 (15:39 -0500)]
xml: support for > in tags
This introduces support for selecting which subelement
to unmarshal into a given struct field by providing a
nesting path separated by the > character.