go test runs the tests itself; it does not run the gotest command,
so these mentions are confusing.
R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5551043
On 32-bit machines, %g takes an extra malloc. I don't know why yet,
but this makes the test pass again, and enables it even for -short.
Fixes#2653.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5542055
Duplicated fields from URL were dropped so that its behavior
is simple and expected when being stringified and when being
operated by packages like http. Most of the preserved fields
are in unencoded form, except for RawQuery which continues to
exist and be more easily handled via url.Query().
The RawUserinfo field was also replaced since it wasn't practical
to use and had limitations when operating with empty usernames
and passwords which are allowed by the RFC. In its place the
Userinfo type was introduced and made accessible through the
url.User and url.UserPassword functions.
What was previous built as:
url.URL{RawUserinfo: url.EncodeUserinfo("user", ""), ...}
Is now built as:
url.URL{User: url.User("user"), ...}
R=rsc, bradfitz, gustavo
CC=golang-dev
https://golang.org/cl/5498076
The terminal code in exp/terminal was forked from the code in exp/ssh.
This change removes the duplicated code from exp/ssh in favour of
using exp/terminal.
R=rsc
CC=golang-dev
https://golang.org/cl/5375064
This CL revises existing platform-dependent default socket
options to make it possible to accomodate multiple multicast
datagram listeners on a single service port.
Also removes unnecessary SO_REUSEADDR, SO_REUSEPORT socket
options from unicast datagram sockets by default.
Fixes#1692.
R=devon.odell, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5538052
(This was missing in the last change because I uploaded it from the
wrong machine.)
Large pastes previously misbehaved because the code tried reading from
the terminal before checking whether an line was already buffered.
Large pastes can cause multiples lines to be read at once from the
terminal.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5542049
exp/proxy provides client support for tunneling connections through
various proxies.
This is an initial, incomplete sketch of the code to lay down an
API.
R=golang-dev, r, r, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5490062
Also verified in external test suite that this fixes MySQL
resource exhaustion problems, and also exposed a double-free
bug in the gosqlite3 driver (where gosqlite3 either got lucky
before, or was working around this bug)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5544057
The implementation is similar to the one from the double-conversion
library used in the Chrome V8 engine.
old ns/op new ns/op speedup
BenchmarkAppendFloatDecimal 591 480 1.2x
BenchmarkAppendFloat 2956 486 6.1x
BenchmarkAppendFloatExp 10622 503 21.1x
BenchmarkAppendFloatNegExp 40343 483 83.5x
BenchmarkAppendFloatBig 2798 664 4.2x
See F. Loitsch, ``Printing Floating-Point Numbers Quickly and
Accurately with Integers'', Proceedings of the ACM, 2010.
R=rsc
CC=golang-dev, remy
https://golang.org/cl/5502079
Merge package files in the go/ast MergePackageFiles
function always in the same order (sorted by filename)
instead of map iteration order to obtain the same
package file each time. This functionality is used
by godoc when displaying packages in ?m=src mode.
Also: minor cleanup in godoc.go.
R=rsc
CC=golang-dev
https://golang.org/cl/5540054
This CL improves the xml package in the following ways:
- makes its interface match established conventions
- brings Marshal and Unmarshal closer together
- fixes a large number of bugs and adds tests
- improves speed significantly
- organizes and simplifies the code
Fixes#2426.
Fixes#2406.
Fixes#1989.
What follows is a detailed list of those changes.
- All matching is case sensitive without special processing
to the field name or xml tag in an attempt to match them.
Customize the field tag as desired to match the correct XML
elements.
- Flags are ",flag" rather than "flag". The names "attr",
"chardata", etc, may be used to name actual XML elements.
- Overriding of attribute names is possible with "name,attr".
- Attribute fields are marshalled properly if they have
non-string types. Previously they were unmarshalled, but were
ignored at marshalling time.
- Comment fields tagged with ",comment" are marshalled properly,
rather than being marshalled as normal fields.
- The handling of the Any field has been replaced by the ",any"
flag to avoid unexpected results when using the field name for
other purposes, and has also been fixed to interact properly
with name paths. Previously the feature would not function
if any field in the type had a name path in its tag.
- Embedded struct support fixed and cleaned so it works when
marshalling and also when using field paths deeper than one level.
- Conflict reporting on field names have been expanded to cover
all fields. Previously it'd catch only conflicts of paths
deeper than one level. Also interacts correctly with embedded
structs now.
- A trailing '>' is disallowed in xml tags. It used to be
supported for removing the ambiguity between "attr" and "attr>",
but the marshalling support for that was broken, and it's now
unnecessary. Use "name" instead of "name>".
- Fixed docs to point out that a XMLName doesn't have to be
an xml.Name (e.g. a struct{} is a good fit too). The code was
already working like that.
- Fixed asymmetry in the precedence of XML element names between
marshalling and unmarshalling. Marshal would consider the XMLName
of the field type before the field tag, while unmarshalling would
do the opposite. Now both respect the tag of the XMLName field
first, and a nice error message is provided in case an attempt
is made to name a field with its tag in a way that would
conflict with the underlying type's XMLName field.
- Do not marshal broken "<???>" tags when in doubt. Use the type
name, and error out if that's not possible.
- Do not break down unmarshalling if there's an interface{} field
in a struct.
- Significant speed boost due to caching of type metadata and
overall allocation clean ups. The following timings reflect
processing of the the atom test data:
Old:
BenchmarkMarshal 50000 48798 ns/op
BenchmarkUnmarshal 5000 357174 ns/op
New:
BenchmarkMarshal 100000 19799 ns/op
BenchmarkUnmarshal 10000 128525 ns/op
R=cw, gustavo, kevlar, adg, rogpeppe, fullung, christoph, rsc
CC=golang-dev
https://golang.org/cl/5503078
- the main changes are removing the Doc suffix
from the exported types, so instead of
doc.TypeDoc one will have doc.Type, etc.
- All exported types now have a Name (or Names) field.
For Values, the Names field lists all declared variables
or constants.
- Methods have additional information about where they are
coming from.
- There's a mode field instead of a bool to
control the package's operation, which makes
it easier to extend w/o API changes.
Except for the partially implemented new Method type,
this is based on existing code. A clean rewrite is in
progress based on this new API.
R=rsc, kevlar
CC=golang-dev
https://golang.org/cl/5528060
Only ParseFile, ParseDir, and ParseExpr are used in the tree.
If partial parsing of code is required, it is fairly simple
to wrap the relevant piece of code into a dummy package for
parsing (see parser.ParseExpr).
Also: minor cleanups.
R=rsc
CC=golang-dev
https://golang.org/cl/5535055
These functions are mostly of interest for debugging; the
number of bytes written is uninteresting.
R=r, bradfitz
CC=golang-dev
https://golang.org/cl/5540046
By the time a Unix linker gets to the end of the
command line it has forgotten what you told it
at the beginning of the command line, so you
have to put library arguments (like -lm) at the end.
R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5541043
In a test that does
func TestFoo(t *testing.T) {
defer cleanup()
t.Fatal("oops")
}
it can be important that cleanup run as the test fails.
The old code did this in Fatal:
t.signal <- t
runtime.Goexit()
The runtime.Goexit would run the deferred cleanup
but the send on t.signal would cause the main test loop
to move on and possibly even exit the program before
the runtime.Goexit got a chance to run.
This CL changes tRunner (the top stack frame of a test
goroutine) to send on t.signal as part of a function
deferred by the top stack frame. This delays the send
on t.signal until after runtime.Goexit has run functions
deferred by the test itself.
For the above TestFoo, this CL guarantees that cleanup
will run before the test binary exits.
This is particularly important when cleanup is doing
externally visible work, like removing temporary files
or unmounting file systems.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5532078
Especially affects tests, but not test-specific.
The linker was only being told where to find the
direct dependencies of package main. Sometimes that
was sufficient to find the rest; sometimes not.
Fixes#2657.
Fixes#2666.
Fixes#2680.
R=golang-dev, adg, rogpeppe
CC=golang-dev
https://golang.org/cl/5528079
This breakage is mainly due to API changes in pkg.
(e.g., package utf8 moved to unicode/utf8;
remove of strconv.Atof64;
change character type from int to rune.)
Also correct the usage comment.
This fixes issue 2646.
PS: I don't change the goyacc.go, because I think token type
should not be force to rune.
R=golang-dev, adg, rogpeppe, r, r
CC=golang-dev
https://golang.org/cl/5502093
The escape analysis code does not make a distinction between
scalar and pointers fields in structs. Non-pointer fields
that escape should not make the whole struct escape.
R=lvd, rsc
CC=golang-dev, remy
https://golang.org/cl/5489128
Tighter octal parsing broke some tests and were disabled in
https://golang.org/cl/5530051
Those tests were broken. The CSS decoder was supposed to see CSS
hex escape sequences of the form '\' <hex>+, but those escape
sequences were instead being consumed by the template parser.
This change properly escapes those escape sequences, and uses
proper escaping for NULs.
R=golang-dev, rsc, nigeltao
CC=golang-dev
https://golang.org/cl/5529073
- Changed the Scan API semantics slightly:
The token literal string is only returned
if the token is a literal, comment, semicolon,
or illegal character. In all other cases, the
token literal value is determined by the token
value.
Clients that care about the token literal value
when not present can always use the following
piece of code:
pos, tok, lit := scanner.Scan()
if lit == "" {
lit = tok.String()
}
- Changed token.Lookup API to use a string instead
of a []byte argument.
- Both these changes were long-standing TODOs.
- Added BenchmarkScan.
This change permits a faster implementation of Scan
with much fewer string creations:
benchmark old ns/op new ns/op delta
scanner.BenchmarkScan 74404 61457 -17.40%
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5532076
This is a relic from the times when we switched
to automatic semicolon insertion. It's still use-
ful to have a non-exported switch for testing.
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5528077
1) Include Szabolcs Nagy's patch which adds serialisation for more
signature subpackets.
2) Include Szabolcs Nagy's patch which adds functions for making DSA
keys.
3) Make the random io.Reader an argument to the low-level signature
functions rather than having them use crypto/rand.
4) Rename crypto/openpgp/error to crypto/openpgp/errors so that it
doesn't clash with the new error type.
R=bradfitz, r
CC=golang-dev
https://golang.org/cl/5528044
Will have to do better but this is enough to
stop the builders from hanging, I hope.
R=golang-dev, dsymonds, adg
CC=golang-dev
https://golang.org/cl/5533066
pkg/runtime/sys_darwin_amd64.s: fixes syscall select nr
pkg/runtime/sys_linux_arm.s: uses newselect instead of the now unimplemented
(old) select, also fixes the wrong div/mod statements in runtime.usleep.
Fixes#2633
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/5504096
What package image currently provides is a larger image consisting
of many copies of a smaller image.
More generally, a tiled image could be a quilt consisting of different
smaller images (like Google Maps), or a technique to view a portion of
enormous images without requiring the whole thing in memory.
This richer construct might not ever belong in the standard library (and
is definitely out of scope for Go 1), but I would like the option for
image.Tiled to be its name.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5530062
flag -l means: inlining on, -ll inline with early typecheck
-l lazily typechecks imports on use and re-export, nicer for debugging
-lm produces output suitable for errchk tests, repeated -mm... increases inl.c's verbosity
export processed constants, instead of originals
outparams get ->inlvar too, and initialized to zero
fix shared rlist bug, that lead to typecheck messing up the patched tree
properly handle non-method calls to methods T.meth(t, a...)
removed embryonic code to handle closures in inlined bodies
also inline calls inside closures (todo: move from phase 6b to 4)
Fixes#2579.
R=rsc
CC=golang-dev
https://golang.org/cl/5489106
This fixes issue 2444.
A big cleanup of all 31/32bit size boundaries i'll leave for another cl though. (see also issue 1700).
R=rsc
CC=golang-dev
https://golang.org/cl/5484058
On my MacBookAir4,1:
19.94r go install -a -p 1 std
12.36r go install -a -p 2 std
9.76r go install -a -p 3 std
10.77r go install -a -p 4 std
86.57r go test -p 1 std -short
52.69r go test -p 2 std -short
43.75r go test -p 3 std -short
40.44r go test -p 4 std -short
157.50r go test -p 1 std
99.58r go test -p 2 std
87.24r go test -p 3 std
80.18r go test -p 4 std
R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/5531057
is consistent with what the Go compiler returns when such sequences
appear in string literals.
Fixes#2658.
R=golang-dev, rsc, r, r, nigeltao
CC=golang-dev
https://golang.org/cl/5530051
The -v flag prints the names of packages as they are built/installed.
Use -v in make.bash/run.bash to avoid a silent pause during
the build while Go code is being compiled.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5532055
- separated exported data structures from doc reader
by extracting all exported data structures into doc.go
and moving the implementation into reader.go
- added missing documentation comments
- no API or semantic changes (but moved positions of
PackageDoc.Doc and TypeDoc.Decl field up for consistency)
- runs all tests
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5527063
shorten the MathML namespace abbreviation from "mathml" to "math".
Python's html5lib uses "mathml", but I think that that is an internal
implementation detail; the test cases use "math".
Pass tests10.dat, test 30:
<div><svg><path><foreignObject><math></div>a
| <html>
| <head>
| <body>
| <div>
| <svg svg>
| <svg path>
| <svg foreignObject>
| <math math>
| "a"
R=andybalholm
CC=golang-dev
https://golang.org/cl/5529044
This fixes the most annoying bug in the go command,
that 'go build' sometimes ignored packages it had just
rebuilt in favor of stale installed ones.
This part of the code needs more thought, but this small
change is an important improvement.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5531053
I didn't believe that OpenPGP allowed > SHA-1 with DSA, but it does and
so we need to perform hash truncation.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5510044
The recover code assumes that the panic() argument was
an error, but it is usually a simple string.
Fixes#2663.
R=golang-dev, r, r, gri
CC=golang-dev, remy
https://golang.org/cl/5527046