1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:21:22 -06:00
Commit Graph

5070 Commits

Author SHA1 Message Date
Russ Cox
6f77cd2914 strconv: fix round up corner case
Comment described the correct condition
but the code did not implement it.

Fixes #2625.

R=remyoudompheng
CC=golang-dev
https://golang.org/cl/5530082
2012-01-12 11:32:28 -08:00
Brad Fitzpatrick
701f70abf6 sql: fix potential corruption in QueryRow.Scan into a *[]byte
Fixes #2622

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5533077
2012-01-12 11:23:33 -08:00
Russ Cox
fb036824df go/build: allow colon in #cgo flags
This makes it possible to say -I c:/foo on Windows.

Fixes #2683 comment #3.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5540043
2012-01-12 11:05:54 -08:00
Russ Cox
4953b87296 testing: fix defer race
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
2012-01-12 10:18:12 -08:00
Dmitriy Vyukov
a03c519a8c effective_go: provide reference to runtime.NumCPU()
R=golang-dev, robert.hencke, r
CC=golang-dev
https://golang.org/cl/5538050
2012-01-12 22:06:50 +04:00
Andrew Gerrand
e955a3cca2 net/textproto: always copy the data from bufio to avoid corruption
Fixes #2621.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5498104
2012-01-12 14:15:58 +11:00
Russ Cox
610757b155 runtime: delete duplicate implementation of pcln walker
It's hard enough to get right once.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5533073
2012-01-11 18:45:32 -08:00
Mike Samuel
b1d6fa517c html/template: reenable testcases and fix mis-escaped sequences.
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
2012-01-11 18:47:03 -05:00
Robert Griesemer
3fc327b33b go/scanner: 17% faster scanning
- 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
2012-01-11 14:20:32 -08:00
Robert Griesemer
276f177b9c go/scanner: remove (exported) InsertSemis mode
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
2012-01-11 10:06:44 -08:00
Robert Griesemer
a30b172ca0 go/printer: don't crash if AST contains BadXXX nodes
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5535048
2012-01-11 08:32:03 -08:00
Adam Langley
b1bad5530a Makefile: update openpgp/error -> openpgp/errors
R=golang-dev
CC=golang-dev
https://golang.org/cl/5530078
2012-01-11 08:39:29 -05:00
Adam Langley
a68494bf21 crypto/openpgp: assorted cleanups
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
2012-01-11 08:35:32 -05:00
Shenghou Ma
1250f94f93 runtime: runtime.usleep() bugfix on darwin/amd64 and linux/arm
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
2012-01-10 20:48:02 -08:00
Russ Cox
8fe7701301 os: work around inlining bug (issue 2678)
TBR=lvd
CC=golang-dev
https://golang.org/cl/5534070
2012-01-10 20:26:11 -08:00
Alex Brainman
d03bfa8e5b net: fix windows build
R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5533065
2012-01-11 14:55:10 +11:00
Russ Cox
a6d8b483b6 runtime: make garbage collector faster by deleting code
Suggested by Sanjay Ghemawat.  5-20% faster depending
on the benchmark.

Add tree2 garbage benchmark.
Update other garbage benchmarks to build again.

R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/5530074
2012-01-10 19:49:11 -08:00
Robert Griesemer
2b6288113e go/scanner: fix documentation
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5528070
2012-01-10 18:31:27 -08:00
Robert Griesemer
090049130e go/ast: predeclared objects have the Universe/Unsafe scope as Decl
Makes it possible to easily detect if an Object was predeclared
(as opposed to unresolved).

R=rsc
CC=golang-dev
https://golang.org/cl/5530072
2012-01-10 18:30:06 -08:00
Mikio Hara
b06514bb34 syscall: fix windows build
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5533063
2012-01-10 18:27:09 -08:00
Nigel Tao
415f15b667 image: rename image.Tiled to image.Repeated.
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
2012-01-11 12:35:05 +11:00
Mikio Hara
cbdbdc4f61 net: add IP-level socket option helpers for Unix variants
Also reorganize socket options stuff but there are no API behavioral
changes.

R=rsc, fullung
CC=golang-dev
https://golang.org/cl/5494067
2012-01-11 09:53:32 +09:00
Nigel Tao
aa033c20b3 html: propagate foreign namespaces only when adding foreign content.
Pass tests10.dat, test 31:
<div><svg><path><foreignObject><p></div>a

| <html>
|   <head>
|   <body>
|     <div>
|       <svg svg>
|         <svg path>
|           <svg foreignObject>
|             <p>
|               "a"

Also pass test 32:
<!DOCTYPE html><svg><desc><div><svg><ul>a

R=andybalholm
CC=golang-dev
https://golang.org/cl/5527064
2012-01-11 10:15:40 +11:00
Maxim Pimenov
dcdc309c7c runtime: fix typo in comment
R=golang-dev
CC=golang-dev
https://golang.org/cl/5529059
2012-01-10 12:56:25 -08:00
Brad Fitzpatrick
4435c8bf2a exp/sql: close Rows on EOF
Fixes #2624

R=rsc
CC=golang-dev
https://golang.org/cl/5530068
2012-01-10 12:51:27 -08:00
Russ Cox
5032a7dc0c runtime: distinct panic message for call of nil func value
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5531062
2012-01-10 11:46:57 -08:00
Dave Cheney
bc1f4c1823 runtime: regenerate defs_darwin_{386,amd64}.h
Regenerated under Lion 10.7.2 amd64.
Also tested on Snow Leopart 10.6.8 386.

R=golang-dev, dsymonds, minux.ma
CC=golang-dev
https://golang.org/cl/5533058
2012-01-10 09:48:10 -08:00
Devon H. O'Dell
12bf00054e runtime: enable runtime.ncpu on FreeBSD
R=adg, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5528062
2012-01-10 17:39:17 +11:00
Russ Cox
6dfdd4c1e3 runtime: add NumCPU
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5528061
2012-01-09 18:45:59 -08:00
Sameer Ajmani
cbf4f4b8d0 strconv: return ErrSyntax when unquoting illegal octal sequences. This
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
2012-01-09 19:55:18 -05:00
Brad Fitzpatrick
024952fb8a syscall: make Environ return original order
Fixes #2619

R=r, rsc
CC=golang-dev
https://golang.org/cl/5528058
2012-01-09 16:51:20 -08:00
Robert Griesemer
22dfc77c99 go/doc: first steps towards cleaning up go/doc
- 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
2012-01-09 16:14:01 -08:00
Nigel Tao
748fab9d11 html: foreign element HTML integration points, tag name adjustment,
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
2012-01-10 11:06:09 +11:00
Anthony Martin
1421b4ceff syscall: ignore godefs input when building on Plan 9
R=golang-dev, akumar, rsc
CC=golang-dev
https://golang.org/cl/5534055
2012-01-09 15:09:40 -08:00
Russ Cox
cc02ef0258 os: add ModeCharDevice
This should make conversion from Unix mode
to os.FileMode and back not lossy.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5531052
2012-01-09 14:22:53 -08:00
Adam Langley
f942736495 crypto/openpgp: truncate hashes before checking DSA signatures.
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
2012-01-09 16:57:51 -05:00
Rémy Oudompheng
f5d024a746 text/template: handle panic values that are not errors.
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
2012-01-09 12:54:31 -08:00
Alexey Borzenkov
793768e9d5 encoding/gob: fix panic when decoding []byte to incompatible slice types
Fixes #2662.

R=golang-dev, rogpeppe, r, r
CC=golang-dev, r, rogpeppe
https://golang.org/cl/5515050
2012-01-09 12:52:03 -08:00
Robert Griesemer
b4be65bc7f math/big: simplify fast string conversion
- use slice ops for convertWords instead of lo/hi boundaries
- always compute leading zeroes (simplifies logic significantly),
  but remove them once, at the end (since leafSize is small, the
  worst-case scenario is not adding significant overhead)
- various comment cleanups (specifically, replaced direct -> iterative,
  and indirect -> recursive)
- slightly faster overall for -bench=String

(This CL incorporates the changes re: my comments to CL 5418047
https://golang.org/cl/5418047/ )

benchmark                          old ns/op    new ns/op    delta
big.BenchmarkString10Base2               519          527   +1.54%
big.BenchmarkString100Base2             2279         2158   -5.31%
big.BenchmarkString1000Base2           18475        17323   -6.24%
big.BenchmarkString10000Base2         178248       166219   -6.75%
big.BenchmarkString100000Base2       1548494      1431587   -7.55%
big.BenchmarkString10Base8               415          422   +1.69%
big.BenchmarkString100Base8             1025          978   -4.59%
big.BenchmarkString1000Base8            6822         6428   -5.78%
big.BenchmarkString10000Base8          64598        61065   -5.47%
big.BenchmarkString100000Base8        593788       549150   -7.52%
big.BenchmarkString10Base10              654          645   -1.38%
big.BenchmarkString100Base10            1863         1835   -1.50%
big.BenchmarkString1000Base10          12099        11981   -0.98%
big.BenchmarkString10000Base10         57601        56888   -1.24%
big.BenchmarkString100000Base10     20123120     19827890   -1.47%
big.BenchmarkString10Base16              358          362   +1.12%
big.BenchmarkString100Base16             815          776   -4.79%
big.BenchmarkString1000Base16           4710         4421   -6.14%
big.BenchmarkString10000Base16         43938        40968   -6.76%
big.BenchmarkString100000Base16       406307       373930   -7.97%

R=michael.jones, mtj
CC=golang-dev
https://golang.org/cl/5432090
2012-01-09 11:20:09 -08:00
Albert Strasheim
2cb6fcf63f syscall: Linux-only support for parent death signal
As discussed in this thread:

https://groups.google.com/group/golang-dev/browse_thread/thread/5b76b7700265a787

I've tried to come up with a solution that is minimally invasive for the platforms that don't support "parent death signal", without splitting up exec_unix.go.

See also: http://www.win.tue.nl/~aeb/linux/lk/lk-5.html#ss5.8

R=rsc, dave, borman, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5487061
2012-01-09 21:37:46 +09:00
Andrew Gerrand
c7e91724c0 go/build: handle and warn of duplicate GOPATH entries
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5519050
2012-01-09 14:24:05 +11:00
Wei Guangjing
9569c67a6b windows: use ArbitraryUserPointer as TLS slot
R=hectorchu, alex.brainman
CC=golang-dev
https://golang.org/cl/5519054
2012-01-09 11:23:07 +11:00
Florian Weimer
0448ce13a0 encoding/asn1: document support for *big.Int
Also add basic tests.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5533045
2012-01-08 10:02:23 -05:00
Sameer Ajmani
1379d90651 time: fix godoc for After and NewTicker.
R=golang-dev, gri, bradfitz, iant
CC=golang-dev, rsc
https://golang.org/cl/5523049
2012-01-07 20:53:53 -05:00
Robert Griesemer
e36acdfb56 sort: eliminate extra Len() call
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5521052
2012-01-05 18:40:17 -08:00
Robert Hencke
a3baccefd6 various: fix prints
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5516049
2012-01-05 18:38:01 -08:00
Charles L. Dorian
149d3f06d8 math: fix typo in all_test.go
Logb errors were reported as Ilogb errors.

R=rsc, golang-dev, gri
CC=golang-dev
https://golang.org/cl/5517045
2012-01-05 11:04:14 -08:00
Mikio Hara
bab56ecb4d net: fix incorrect mode on ListenIP, ListenUDP
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5523044
2012-01-05 09:44:25 -08:00
Jeff R. Allen
c581ec4918 crypto/tls: Improve TLS Client Authentication
Fix incorrect marshal/unmarshal of certificateRequest.
Add support for configuring client-auth on the server side.
Fix the certificate selection in the client side.
Update generate_cert.go to new time package

Fixes #2521.

R=krautz, agl, bradfitz
CC=golang-dev, mikkel
https://golang.org/cl/5448093
2012-01-05 12:05:38 -05:00
Andrew Gerrand
2469a817ba net: update DialIP comments to mention protocols
Fixes #2637.

R=golang-dev, mikioh.mikioh, iant
CC=golang-dev
https://golang.org/cl/5508043
2012-01-05 15:18:08 +11:00
Robert Griesemer
3f1eb94ef2 runtime: fix typo in comment
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5511047
2012-01-04 14:06:54 -08:00
Adam Langley
d5e6b8d016 crypto/tls: update generate_cert.go for new time package
Fixes #2635.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5512043
2012-01-04 14:56:16 -05:00
Dave Cheney
424f53fa0c exp/ssh: fix two flow control bugs in chanWriter
This CL fixes two issues sending data to the remote peer.
The first bug occurs when the size of the buffer passed to
Write is larger than the current window, in this case, w.rwin
can become negative.

The second issue is more problematic than the first as the
amount of data passed to writePacket was not limited to w.rwin.
In this case the remote peer could silently drop the additional
data, or drop the connection.

Credit to Jacek Masiulaniec for the bug report.

R=agl, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/5511043
2012-01-04 10:36:21 -05:00
Andrew Gerrand
9d92676f63 unsafe: refer to correct reflect functions
Fixes #2641.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5509043
2012-01-04 17:14:56 +11:00
Andrew Balholm
99fed2be27 html: parse <frameset> inside body
Pass tests6.dat, test 47:
<param><frameset></frameset>

| <html>
|   <head>
|   <frameset>

Also pass remaining tests in tests6.dat.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5489136
2012-01-04 09:51:15 +11:00
Evan Shaw
c20c09251c encoding/json: don't marshal special float values
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5500084
2012-01-03 12:30:18 +11:00
Michael Shields
38ff98b4c6 encoding/xml: use strings.Reader in tests.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5502083
2012-01-03 12:22:02 +11:00
Dave Cheney
7f20bcbbcb exp/ssh: various small fixes
transport.go:
* remove unused nil check.

doc.go:
* improve documentation about supported auth
methods and update Run example.

Thanks Jacek Masiulaniec for both reports.

R=jacek.masiulaniec, agl
CC=golang-dev
https://golang.org/cl/5501075
2011-12-27 09:49:19 -05:00
Rob Pike
6a88f1c4cb bytes.Buffer: read of 0 bytes at EOF shouldn't be an EOF
This corner case arose doing an RPC with a empty-slice payload. Ouch.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5505073
2011-12-26 23:49:24 -08:00
Vadim Vygonets
f71c03af90 log/syslog: add Alert method
Alert logs a message using the LOG_ALERT priority.

Fixes #2325.

R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/5504058
2011-12-26 09:34:27 +09:00
David Symonds
98b90475ac flag: change Set method Value interface to return error instead of bool.
This yields much better error messages when a bad flag value is given.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5498078
2011-12-25 16:12:26 +11:00
David Symonds
57c9bb4a07 testing: use flag.Duration for -timeout flag.
R=golang-dev, gustavo, r
CC=golang-dev
https://golang.org/cl/5498077
2011-12-25 16:07:05 +11:00
Nigel Tao
d5e45e3a8a html: adjust foreign attributes.
Pass tests10.dat, test 22:
<!DOCTYPE html><body xlink:href=foo><svg xlink:href=foo></svg>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     xlink:href="foo"
|     <svg svg>
|       xlink href="foo"

Also pass tests through test 29:
<div><svg><path></svg><path>

R=andybalholm
CC=golang-dev
https://golang.org/cl/5489117
2011-12-25 12:42:47 +11:00
Andrew Balholm
b28f017537 html: "in select in table" insertion mode.
Pass tests10.dat, test 16:
<!DOCTYPE
html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>
|           <td>
|             <select>
|               "foobarbaz"
|     <p>
|       "quux"

Also pass tests through test 21:
<!DOCTYPE html><frameset></frameset><svg><g></g><g></g><p><span>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5505069
2011-12-24 11:07:14 +11:00
Marcel van Lohuizen
cadbd3ea49 exp/norm: fixed two unrelated bugs in normalization library.
1) incorrect length given for out buffer in String.
2) patchTail bug that could cause characters to be lost
   when crossing into the out-buffer boundary.

Added tests to expose these bugs.  Also slightly improved
performance of Bytes() and String() by sharing the reorderBuffer
across operations.

Fixes #2567.

R=r
CC=golang-dev
https://golang.org/cl/5502069
2011-12-23 18:21:26 +01:00
Robert Hencke
335c5db76a net/rpc: trivial test cleanup
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5498066
2011-12-23 22:01:46 +09:00
David Symonds
cf506f6eac flag: add Duration flag type.
This works in the expected way: flag.Duration returns a *time.Duration,
and uses time.ParseDuration for parsing the input.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5489113
2011-12-23 16:29:38 +11:00
David Symonds
f298d0ce29 time: add ParseDuration.
R=rsc, r, r
CC=golang-dev
https://golang.org/cl/5489111
2011-12-23 16:28:56 +11:00
Russ Cox
3800b14071 runtime: delete old asm_*.h if still around
Fixes bug Robert ran into.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5501070
2011-12-22 22:24:34 -05:00
Alex Brainman
5962ef2c00 path/filepath: implement Base and Dir for windows
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5501069
2011-12-23 13:23:07 +11:00
Rob Pike
416afcb411 testing: add wrapper methods so the godoc output lists all methods
To be deleted when godoc catches up.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5504079
2011-12-22 17:17:19 -08:00
Andrew Balholm
4a8ea4ae94 html: Don't ignore whitespace in "after after frameset" mode.
Pass tests6.dat, test 46:
<html><frameset></frameset></html>

| <html>
|   <head>
|   <frameset>
|   " "

R=nigeltao
CC=golang-dev
https://golang.org/cl/5505065
2011-12-23 11:07:11 +11:00
Robert Griesemer
198936f2b8 go/doc, godoc: move export filtering into go/doc
- exports.go contains a stripped-down (but semantically unchanged)
  version of the code in go/ast/filter.go for export filtering
- filter.go contains the documentation filtering code found before
  at the end of doc.go; this is simply a code move w/o any semantic
  changes
- godoc now relies on go/doc for export filtering when creating
  documentation. It still has a separate form of export filtering
  for showing the source code version. This needs to be consolidated
  (perhaps the source form view should just be removed?).
- Stripping of function bodies (stripFunctionBodies function of
  godoc.go) is now happening in doc.go (line 176).
- doc.NewPackageDoc has an extra parameter "exportsOnly. If set
  to false, the behavior is as before. This function is only called
  once in our source code; a gofix module is probably not warranted.
- Deleted doc.NewFileDoc - was never called.

This change is mostly a code move w/ some minimal tweaks. It should
not cause any changes to the behavior of godoc. It's a prerequisite
for extracting anonymous embedded fields.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5502072
2011-12-22 15:28:15 -08:00
Rob Pike
07db252222 fmt: make the malloc test check its counts
Discover than %g is now down to 1 malloc from 2 from 4.
Have fun with funcs.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5504077
2011-12-22 15:16:06 -08:00
Alex Brainman
102c1a7c96 go/build: (*Tree).BinDir should not return path with / in it on windows
R=rsc
CC=golang-dev
https://golang.org/cl/5502064
2011-12-23 09:46:30 +11:00
Rémy Oudompheng
2afebbdf35 strconv: fix bug in extended-float based conversion.
A test intended for denormals erroneously returned true also for
infinities, leading to bad overflows and wrong error estimates.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/5489091
2011-12-22 17:28:35 -05:00
Robert Griesemer
fc78c5aa00 math/big: Rand shouldn't hang if argument is also receiver.
Fixes #2607.

R=rsc
CC=golang-dev
https://golang.org/cl/5489109
2011-12-22 14:15:41 -08:00
Rob Pike
b6122b0a64 path: Dir
There was Base but not Dir, so fill in the gap.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5504076
2011-12-22 14:08:34 -08:00
Robert Griesemer
c0589a21c9 go/doc: s/typeDoc/typeInfo/
To avoid confusion between typeDoc and TypeDoc.
No semantic change.

R=r
CC=golang-dev
https://golang.org/cl/5502071
2011-12-22 14:00:52 -08:00
Rob Pike
dd1a34bdae path/filepath: Dir
There was Base but not Dir, so fill in the gap.

R=n13m3y3r, r, rsc, gustavo
CC=golang-dev
https://golang.org/cl/5503067
2011-12-22 13:58:58 -08:00
Robert Griesemer
7ea92ddd66 go/doc, godoc: show methods of anonymous fields
Missing: Handling of embedded interfaces.

Also, for reasons outlined in the previous CL (5500055), embedded
types have to be exported for its "inherited" methods to be visible.
This will be addressed w/ a subsequent CL.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5502059
2011-12-22 13:11:40 -08:00
Rob Pike
b1a287e3a1 testing: fix the fix to the wording about the bug
TBR=rsc

R=rsc
CC=golang-dev
https://golang.org/cl/5498070
2011-12-22 11:23:10 -08:00
Rob Pike
34139ee155 testing: fix wording in explanation of potential bug
TBR=rsc

R=rsc
CC=golang-dev
https://golang.org/cl/5504075
2011-12-22 11:08:51 -08:00
Rob Pike
66155134a7 testing: make signalling safer for parallel tests
Each test gets a private signal channel.
Also fix a bug that prevented parallel tests from running.

R=r, r
CC=golang-dev
https://golang.org/cl/5505061
2011-12-22 10:43:54 -08:00
Robert Hencke
b5216e2e55 testing: compare Log to Println
Log always adds spaces between operands, like Println but unlike Print

R=golang-dev
CC=golang-dev
https://golang.org/cl/5504069
2011-12-22 10:05:51 -08:00
Adam Langley
7350c771f8 exp/terminal: several cleanups
1) Add EscapeCodes to the terminal so that applications don't wire
   them in.
2) Add a callback for auto-complete
3) Fix an issue with input lines longer than the width of the
   terminal.
4) Have Write() not stomp the current line. It now erases the current
   input, writes the output and reprints the prompt and partial input.
5) Support prompting without local echo in Terminal.
6) Add GetSize to report the size of terminal.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5479043
2011-12-22 11:23:57 -05:00
Joel Sing
f1ebbf80bd syscall: make pipe work on netbsd
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5504070
2011-12-23 02:47:48 +11:00
Brad Fitzpatrick
a626adce1e os: update package location of exec to os/exec in comments
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5503065
2011-12-22 07:25:43 -08:00
Joel Sing
43bc8a9b53 syscall: make getdirentries work on netbsd
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5504068
2011-12-22 23:42:43 +11:00
Brad Fitzpatrick
90d56e072f exec: disable the ExtraFiles test on darwin
Still a mystery. New issue 2603 filed.

R=golang-dev, dsymonds, iant
CC=golang-dev
https://golang.org/cl/5503063
2011-12-21 17:08:16 -08:00
Ian Lance Taylor
5690ddc7fa runtime: don't panic on SIGILL, just crash
R=rsc
CC=golang-dev
https://golang.org/cl/5504067
2011-12-21 15:45:36 -08:00
Russ Cox
fa02bac809 os/exec: put the print where it will help
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5501058
2011-12-21 17:49:29 -05:00
Russ Cox
914ab8a23f os/exec: dump lsof on failure
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5504063
2011-12-21 17:17:28 -05:00
Robert Griesemer
89c7e206d1 godoc: fix crash
R=iant, rsc
CC=golang-dev
https://golang.org/cl/5500065
2011-12-21 13:55:47 -08:00
Andrew Gerrand
f2c9d22850 os/exec: enable inherited file descriptor test
Fixes #2596.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5498061
2011-12-22 08:50:56 +11:00
Russ Cox
5e5592cf30 os/user: not on windows
R=golang-dev
CC=golang-dev
https://golang.org/cl/5498062
2011-12-21 16:35:31 -05:00
Russ Cox
0509727b0d build: fixes for Windows
* work around a linker/cgo bug
* do not run deps.bash on Windows unless we need it
  (cuts a full minute off the build time)
* add windows to the list of cgo-enabled targets

The gopack problem is issue 2601.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5504062
2011-12-21 15:57:47 -05:00
Rob Pike
18f7c0a3f6 path/filepath.Rel: document that the returned path is always relative
Fixes #2593.

R=rsc, alex.brainman, n13m3y3r
CC=golang-dev
https://golang.org/cl/5500052
2011-12-21 11:46:42 -08:00
Brad Fitzpatrick
71f0fb7760 crypto/x509: don't crash with nil receiver in accessor method
Fixes #2600

R=golang-dev, agl, rsc
CC=golang-dev
https://golang.org/cl/5500064
2011-12-21 10:49:35 -08:00
Robert Griesemer
97853b46a0 go/doc: steps towards collecting methods of embedded types
No visible external changes yet. The current approach is
a stop-gap approach: For methods of anonymous fields to be
seen, the anonymous field's types must be exported.

Missing: computing the actual MethodDocs and displaying them.

(Depending on the operation mode of godoc, the input to go/doc
is a pre-filtered AST with all non-exported nodes removed. Non-
exported anonymous fields are not even seen by go/doc in this
case, and it is impossible to collect associated (even exported)
methods. A correct fix will require some more significant re-
engineering; AST filtering will have to happen later, possibly
inside go/doc.)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5500055
2011-12-21 08:45:00 -08:00
Russ Cox
721e19c24c os/user: fix for arm (non-cgo)
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5504056
2011-12-21 10:17:37 -05:00
Russ Cox
f52a2088ef go/build: add new +build tags 'cgo' and 'nocgo'
This lets us mark net's cgo_stub.go as only to be
built when cgo is disabled.

R=golang-dev, ality, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5489100
2011-12-21 08:51:18 -05:00
Russ Cox
8feab4d5f7 os/signal: not on windows
R=golang-dev
CC=golang-dev
https://golang.org/cl/5500061
2011-12-21 08:20:25 -05:00
Anthony Martin
6645602c0b os/signal: do not build on Plan 9
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5503057
2011-12-21 07:52:07 -05:00
Mikio Hara
836105679e net, syscall: interface address and mask
This CL makes both InterfaceAddrs and Addrs method on Interface
return IPNet struct for representing interface address and mask
like below:

interface "lo0": flags "up|loopback|multicast", ifindex 1, mtu 16384
        interface address "fe80::1/64"
        interface address "127.0.0.1/8"
        interface address "::1/128"
        joined group address "ff02::fb"
        joined group address "224.0.0.251"
        joined group address "ff02::2:65d0:d71e"
        joined group address "224.0.0.1"
 	joined group address "ff01::1"
        joined group address "ff02::1"
        joined group address "ff02::1:ff00:1"

Fixes #2571.

R=rsc
CC=golang-dev
https://golang.org/cl/5489062
2011-12-21 21:39:00 +09:00
Russ Cox
3435438948 runtime: silence darwin/386 build warnings
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5502056
2011-12-21 07:23:03 -05:00
Joel Sing
9ca57a706c crypto/mime/net/time: add netbsd to +build tags
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5501052
2011-12-21 21:44:47 +11:00
Alex Brainman
a462816753 build: multiple fixes to make "go install" work on windows
R=rsc
CC=golang-dev
https://golang.org/cl/5502054
2011-12-21 16:57:44 +11:00
Brad Fitzpatrick
1dfe3d1f6e os: don't trust O_CLOEXEC on OS X
OS X 10.6 doesn't do O_CLOEXEC.
OS X 10.7 does.

For now, always fall back to using syscall.CloseOnExec on darwin.

This can removed when 10.6 is old news, or if we find a
way to cheaply & reliably detect 10.6 vs 10.7 at runtime.

Fixes #2587

R=golang-dev, rsc, iant
CC=golang-dev
https://golang.org/cl/5500053
2011-12-20 15:41:37 -08:00
Nigel Tao
d13ce8115d image/ycbcr: move the Y'CbCr types into image and image/color.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5493084
2011-12-21 10:29:21 +11:00
Nigel Tao
fe28d1aacf html: handle breakout tags in foreign content.
Also recognize that, in the latest version of the HTML5 spec,
foreign content is not an insertion mode, but a separate concern.

Pass tests10.dat, test 13:
<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <table>
|       <caption>
|         <svg svg>
|           <svg g>
|             "foo"
|           <svg g>
|             "bar"
|         <p>
|           "baz"
|     <p>
|       "quux"

Also pass tests through test 15:
<!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux

R=andybalholm
CC=golang-dev
https://golang.org/cl/5494078
2011-12-21 10:00:41 +11:00
Russ Cox
e83cd7f750 build: a round of fixes
TBR=r
CC=golang-dev
https://golang.org/cl/5503052
2011-12-20 17:54:40 -05:00
Brad Fitzpatrick
01507b9ad1 net: fix Windows build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5505048
2011-12-20 14:32:33 -08:00
Russ Cox
41a6165c03 build: use go command during build
If something goes wrong, it should suffice to set
USE_GO_TOOL=false in env.bash to fall back to the
makefiles.  I will delete the makefiles in January.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5502047
2011-12-20 16:50:13 -05:00
Brad Fitzpatrick
964309e2fd net: DialTimeout
Fixes #240

R=adg, dsymonds, rsc, r, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5491062
2011-12-20 13:17:39 -08:00
Rob Pike
4869996b92 template: better error message for empty templates
New("x").ParseFiles("y") can result in an empty "x" template.
Make the message clearer that this is the problem. The error
returns from both template packages in this case were
confusing.

I considered making the method use "x" instead of "y" in
this case, but that just made other situations confusing
and harder to explain.

Fixes #2594.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5498048
2011-12-20 12:58:23 -08:00
Russ Cox
5d429ad013 runtime/cgo: fix build
Two forgotten renames from last CL.

TBR=r
CC=golang-dev
https://golang.org/cl/5502046
2011-12-20 14:42:58 -05:00
Russ Cox
54fb9940cf go: build runtime/cgo
Also rename -v to -x in the build and install commands,
to match the flag in go test (which we can't change
because -v is taken).  Matches sh -x anyway.

R=r, iant, ality
CC=golang-dev
https://golang.org/cl/5504045
2011-12-20 14:25:23 -05:00
Rob Pike
6b772462e4 panics: use the new facilities of testing.B instead
Lots of panics go away.
Also fix a name error in html/template.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5498045
2011-12-20 10:36:25 -08:00
Robert Griesemer
b9697d4a58 go/ast, parser: remember short variable decls. w/ correspoding ident objects
The ast.Object's Decl field pointed back to the corresponding declaration for
all but short variable declarations. Now remember corresponding assignment
statement in the Decl field.

Also: simplified some code for parsing select statements.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5492072
2011-12-20 09:59:09 -08:00
Rob Pike
c50e4f5e2f testing: allow benchmarks to print and fail
Refactors the benchmarks and test code.
Now benchmarks can call Errorf, Fail, etc.,
and the runner will act accordingly.

Because functionality has been folded into an
embedded type, a number of methods' docs
no longer appear in godoc output. A fix is
underway; if it doesn't happen fast enough,
I'll add wrapper methods to restore the
documentation.

R=bradfitz, adg, rsc
CC=golang-dev
https://golang.org/cl/5492060
2011-12-20 09:51:39 -08:00
Roger Peppe
16bf7d9e82 encoding/binary: add more benchmarks
Also add a byte count to the varint benchmarks - this
isn't accurate, of course, but it allows a rough comparison to
the other benchmarks.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496070
2011-12-20 09:25:47 -08:00
Robert Hencke
317ad14c6a time: JSON marshaler for Time
R=golang-dev, dsymonds, hectorchu, r, r
CC=golang-dev
https://golang.org/cl/5496064
2011-12-20 09:01:18 -08:00
Russ Cox
a1198fcc03 go: build runtime
R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/5495068
2011-12-20 10:28:04 -05:00
Ian Lance Taylor
b49625663e syscall: remove unnecessary semicolon from mksyscall.pl
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5495098
2011-12-19 20:57:59 -08:00
Ian Lance Taylor
36397814cc strconv: remove obsolete comment.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5490078
2011-12-19 20:57:32 -08:00
Ian Lance Taylor
21af3d86cd runtime: correct '.' to '·' in comments
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5495097
2011-12-19 20:56:37 -08:00
Andrew Gerrand
7bffdc7247 encoding/binary: add Write and Read examples
R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/5495095
2011-12-20 13:16:36 +11:00
Alex Brainman
b7e9d22528 net/http: test should not leave tmp files behind on windows
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5496067
2011-12-20 11:53:24 +11:00
Alex Brainman
796a2c19ea os: make sure Remove returns correct error on windows
R=golang-dev, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/5493078
2011-12-20 11:52:20 +11:00
Alex Brainman
448d89d67a old/template: close file in TestAll before deleting it
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5491073
2011-12-20 11:51:31 +11:00
Andrew Balholm
a0bd46e70f html: ignore <caption>, <col>, <tbody> etc. when parsing table fragments
Pass tests6.dat, test 36:
<caption><col><colgroup><tbody><tfoot><thead><tr>

| <tr>

Pass tests through test 44:
<body></body></html>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5494055
2011-12-20 10:57:06 +11:00
Brad Fitzpatrick
315b361f89 zip: fix data race in test
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5492073
2011-12-19 15:40:10 -08:00
Mikio Hara
d2933e9902 syscall: regenerate z-files for linux/arm
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/5496062
2011-12-20 07:42:00 +09:00
Ian Lance Taylor
355ed5da82 exec: disable new test to fix build
TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5494075
2011-12-19 14:09:12 -08:00
Rémy Oudompheng
2368b003e0 strconv: implement faster parsing of decimal numbers.
The algorithm is the same as in the double-conversion library
which also implements Florian Loitsch's fast printing algorithm.
It uses extended floats with a 64-bit mantissa, but cannot give
an answer for all cases.

                           old ns/op  new ns/op  speedup
BenchmarkAtof64Decimal         332        322      1.0x
BenchmarkAtof64Float           385        373      1.0x
BenchmarkAtof64FloatExp       9777        419     23.3x
BenchmarkAtof64Big            3934        691      5.7x
BenchmarkAtof64RandomBits    34060        899     37.9x
BenchmarkAtof64RandomFloats   1329        680      2.0x

See F. Loitsch, ``Printing Floating-Point Numbers Quickly and
Accurately with Integers'', Proceedings of the ACM, 2010.

R=ality, rsc
CC=golang-dev, remy
https://golang.org/cl/5494068
2011-12-19 16:45:51 -05:00
Ian Lance Taylor
384329592a net, syscall, os: set CLOEXEC flag on epoll/kqueue descriptor
Enable new test in os.

R=dave, iant, rsc
CC=golang-dev
https://golang.org/cl/5494061
2011-12-19 12:57:49 -08:00
Russ Cox
55889409f8 runtime: separate out auto-generated files, take 2
This is like the ill-fated CL 5493063 except that
I have written a shell script (autogen.sh) instead of
thinking I could possibly write a correct Makefile.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496075
2011-12-19 15:51:13 -05:00
Rémy Oudompheng
4a4c39e7d4 encoding/json: cleanup leftover variables in array decoding.
An old update for API changes in reflect package left several
helper variables that do not have a meaning anymore, and
the type checking of arrays vs slices was broken.
Fixes #2513.

R=ultrotter, rsc
CC=golang-dev, remy
https://golang.org/cl/5488094
2011-12-19 15:32:06 -05:00
Rémy Oudompheng
3a2dec0246 strconv: reduce buffer size for multi-precision decimals.
The longest numbers we have to represent are the smallest denormals.
Their decimal mantissa is not longer than 5^1100. Taking into
account some extra size for in-place operations, 800 digits are
enough. This saves time used for zero intiialization of extra
bytes.

                                        old ns/op  new ns/op    delta
strconv_test.BenchmarkAtof64Decimal           521        334   -35.9%
strconv_test.BenchmarkAtof64Float             572        391   -31.6%
strconv_test.BenchmarkAtof64FloatExp        10242      10036    -2.0%
strconv_test.BenchmarkAtof64Big              4229       4029    -4.7%
strconv_test.BenchmarkFormatFloatDecimal     1396        934   -33.1%
strconv_test.BenchmarkFormatFloat            4295       3341   -22.2%
strconv_test.BenchmarkFormatFloatExp        12035      11181    -7.1%
strconv_test.BenchmarkFormatFloatBig         4213       3229   -23.4%
strconv_test.BenchmarkAppendFloatDecimal     1031        600   -41.8%
strconv_test.BenchmarkAppendFloat            3971       3044   -23.3%
strconv_test.BenchmarkAppendFloatExp        11699      11003    -5.9%
strconv_test.BenchmarkAppendFloatBig         3836       2915   -24.0%

R=golang-dev, bradfitz, rsc
CC=golang-dev, remy
https://golang.org/cl/5491064
2011-12-19 15:03:53 -05:00
Brad Fitzpatrick
178be83e0e exec: add test to verify net package's epoll fd doesn't go to child
R=rsc
CC=golang-dev
https://golang.org/cl/5490075
2011-12-19 09:23:07 -08:00
Christopher Nielsen
5425db8f99 syscall: Changes to the syscall package to support NetBSD.
Not all syscalls are implemented, but many are. On the suggestion
of Joel Sing <jsing@google.com>, the generated files were added
with hg add instead of hg cp, since they are generated on an OS
dependant basis.

R=golang-dev, jsing, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5491050
2011-12-20 03:57:58 +11:00
Adam Langley
2ca4a61658 crypto/tls: don't assume an RSA private key in the API.
We still very much assume it in the code, but with this change in
place we can implement other things later without changing and users
of the package.

Fixes #2319.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5489073
2011-12-19 10:39:30 -05:00
Alex Brainman
10e43384f3 net/http: test both texta and textb values, not texta twice
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5489082
2011-12-19 17:31:20 +11:00
Alex Brainman
c4227f5bb0 io/ioutil: close file in TestWriteFile before deleting it
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5495086
2011-12-19 17:30:14 +11:00
Andrew Gerrand
0b28de9a05 archive/zip: add SetModTime method to FileHeader
Fixes #2574.

R=golang-dev, bradfitz, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5494072
2011-12-19 14:59:41 +11:00
Nigel Tao
18e8441476 html: handle text nodes in foreign content.
Passes tests10.dat, test 6:
<!DOCTYPE html><body><table><svg><g>foo</g></svg></table>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <svg svg>
|       <svg g>
|         "foo"
|     <table>

Also pass tests through test 12:
<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</caption></table>

R=andybalholm
CC=golang-dev
https://golang.org/cl/5495061
2011-12-19 12:20:00 +11:00
Andrew Gerrand
5ede9df5a0 encoding/json: examples for Marshal and Unmarshal
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5493075
2011-12-19 11:16:55 +11:00
Gustavo Niemeyer
12f473f807 text/template: fix handing of nil arguments to functions
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5494070
2011-12-18 22:14:11 -02:00
Christopher Nielsen
5030177ea3 os: Add NetBSD support for recent signal changes.
Add NetBSD to mksignals.sh and generate files.
While we're here, also add netbsd to the +build list where appropriate.

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5492064
2011-12-18 02:29:18 +11:00
Rob Pike
13b26cb36a runtime: use correct traceback file on arm
reported by fred richter

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5494062
2011-12-16 22:52:02 -08:00
Andrew Gerrand
96a5780db8 go/build: remove 'go/build' from error messages
This leads to really confusing messages in goinstall.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5495074
2011-12-17 13:14:18 +11:00
Russ Cox
86dcc431e9 runtime: hg revert -r 6ec0a5c12d75
That was the last build that was close to working.
I will try that change again next week.
Make is being very subtle today.

At the reverted-to CL, the ARM traceback appears
to be broken.  I'll look into that next week too.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5492063
2011-12-16 18:50:40 -05:00
Robert Griesemer
541b67d051 go/printer, gofmt: fine tuning of line spacing
- no empty lines inside empty structs and interfaces
- top-level declarations are separated by a blank line if
  a) they are of different kind (e.g. const vs type); or
  b) there are documentation comments associated with a
     declaration (this is new)
- applied gofmt -w misc src

The actual changes are in go/printer/nodes.go:397-400 (empty structs/interfaces),
and go/printer/printer.go:307-309 (extra line break). The remaining
changes are cleanups w/o changing the existing functionality.

Fixes issue  2570.

R=rsc
CC=golang-dev
https://golang.org/cl/5493057
2011-12-16 15:43:06 -08:00
Russ Cox
72bdd86835 runtime: fix build on gri's machine
Why it was not failing anywhere else I don't know,
but the Makefile was definitely wrong.  The rules
must not run in parallel.

TBR=r
CC=golang-dev
https://golang.org/cl/5489069
2011-12-16 18:31:09 -05:00
Russ Cox
cfd17a1b57 runtime: fix build
I am looking forward to not supporting two build
systems simultaneously.  Make complains about
a circular dependency still, but I don't understand it
and it's probably not worth the time to figure out.

TBR=r
CC=golang-dev
https://golang.org/cl/5496058
2011-12-16 17:58:53 -05:00
Olivier Duperray
32734f4664 websocket: fix a trivial example server
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5491063
2011-12-16 14:24:37 -08:00
Russ Cox
bd9243da22 runtime: separate out auto-generated files
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5493063
2011-12-16 17:04:32 -05:00
Russ Cox
95907c4752 runtime: fix build
TBR=r
CC=golang-dev
https://golang.org/cl/5493061
2011-12-16 15:46:25 -05:00
Russ Cox
851f30136d runtime: make more build-friendly
Collapse the arch,os-specific directories into the main directory
by renaming xxx/foo.c to foo_xxx.c, and so on.

There are no substantial edits here, except to the Makefile.
The assumption is that the Go tool will #define GOOS_darwin
and GOARCH_amd64 and will make any file named something
like signals_darwin.h available as signals_GOOS.h during the
build.  This replaces what used to be done with -I$(GOOS).

There is still work to be done to make runtime build with
standard tools, but this is a big step.  After this we will have
to write a script to generate all the generated files so they
can be checked in (instead of generated during the build).

R=r, iant, r, lucio.dere
CC=golang-dev
https://golang.org/cl/5490053
2011-12-16 15:33:58 -05:00
Rob Pike
474d64d26e encoding/gob: arrays are zero only if their elements are zero
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5494059
2011-12-16 11:52:58 -08:00
Rob Pike
4fb5f5449a gob: isZero for struct values
Fixes #2577.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5492058
2011-12-16 11:33:57 -08:00
Maxim Pimenov
bf6dd2db04 various: use $GCFLAGS and $GCIMPORTS like Make does
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5489065
2011-12-16 11:31:39 -05:00
Volker Dobler
dd694fb149 net/http: Added interface for a cookie jar.
Types implementing CookieJar may be used in a Client
to persist cookies.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5399043
2011-12-16 10:48:41 -05:00
Mikio Hara
055b4f7ea0 syscall: sort Makefile, mkall.sh and mkerrors.sh entries
R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5495062
2011-12-16 19:51:25 +09:00
Mikio Hara
ecc317647b net: sort Makefile entries
R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5493058
2011-12-16 19:50:55 +09:00
Alex Brainman
8fa8ebf834 go/build: make sure syslist.go is gofmted
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5490051
2011-12-16 15:52:30 +11:00
Russ Cox
0358c8957a io/ioutil: remove another reference to _test
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5492051
2011-12-15 19:32:47 -05:00
Russ Cox
6699aa4aee crypto/tls: quiet build
On a Mac, all the useful functions are deprecated.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5493054
2011-12-15 18:37:31 -05:00
Russ Cox
b53856c16d os/exec: fix -test.run argument for new 'go test'
In 'go test' I deleted the leading package. prefix
from all the test names, since it contained no actual
information.  Adjust the -test.run argument accordingly.
This will still work with the current gotest too, since
the argument is an unanchored pattern.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5491058
2011-12-15 18:21:38 -05:00
Russ Cox
f99b412813 io/ioutil, old/template: do not assume _test exists for scratch space
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496052
2011-12-15 18:21:29 -05:00
Rob Pike
197eb8f7c3 govet: add checking for printf verbs
Also fix the errors it catches.

Fixes #1654.

R=rsc
CC=golang-dev
https://golang.org/cl/5489060
2011-12-15 15:17:52 -08:00
Andrew Gerrand
9834a25d33 testing: trim spaces before comparing example output
bytes: add two Buffer examples

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5490048
2011-12-16 09:43:58 +11:00
Nigel Tao
a369004e23 html: handle end tags in foreign objects.
I'm not 100% sure I get all the corner cases right, for end tags, but
I'll let the test suite smoke it out.

Pass tests10.dat, test 1:
<!DOCTYPE html><svg></svg><![CDATA[a]]>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <svg svg>
|     <!-- [CDATA[a]] -->

Also pass tests through test 5:
<!DOCTYPE html><body><table><svg></svg></table>

R=andybalholm
CC=golang-dev
https://golang.org/cl/5495044
2011-12-16 09:36:50 +11:00
Robert Griesemer
9f65e99ad4 go/printer, gofmt: don't write too many newlines
In some rare cases, gofmt would accept more than the maximum
number of empty lines (1) between source code snippets.

The actual change is in printer.go, lines 773-775; the rest
is some minor restructuring.

Applied gofmt -w src misc .

Fixes #2387.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496047
2011-12-15 13:51:47 -08:00
Dave Cheney
52c8107a3c exp/ssh: simplify Stdin/out/errPipe methods
If a Pipe method is called, return the underlying
reader/writer from session.clientChan, bypassing the
io.Copy and io.Pipe harness.

StdoutPipe and StderrPipe now return an io.Reader not
an io.ReadCloser as SSH cannot signal the close of the
local reader to the remote process.

R=rsc, agl, gustav.paul, cw
CC=golang-dev
https://golang.org/cl/5493047
2011-12-15 16:50:41 -05:00
Rob Pike
04faa08c07 fmt: speed up floating point print, clean up some code
%g down to two mallocs from four. Also a mild speedup.

fmt_test.BenchmarkSprintfFloat         3016         2703  -10.38%

Fixes #2557.

R=rsc
CC=golang-dev
https://golang.org/cl/5491054
2011-12-15 12:52:29 -08:00
Brad Fitzpatrick
29264c6f4f json: use strconv.Append variants to avoid allocations in encoding
Before/after, best of 3:
json.BenchmarkCodeEncoder  10  183495300 ns/op  10.58 MB/s
->
json.BenchmarkCodeEncoder  10  133025100 ns/op  14.59 MB/s

But don't get too excited about this.  These benchmarks, while
stable at any point of time, fluctuate wildly with any line of
code added or removed anywhere in the path due to stack splitting
issues.

It's currently much faster, though, and this is the API that
doesn't allocate so should always be faster in theory.

R=golang-dev, dsymonds, rsc, r, gri
CC=golang-dev
https://golang.org/cl/5411052
2011-12-15 11:21:21 -08:00
Robert Griesemer
fb6ffd8f78 go/scanner: strip CRs from raw literals
R=rsc
CC=golang-dev
https://golang.org/cl/5495049
2011-12-15 10:51:32 -08:00
Russ Cox
fd1f10966d more tags for go/build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5490047
2011-12-15 13:35:59 -05:00
Brad Fitzpatrick
ea51dd23b4 sql: add Rows.Columns
Also, fix package name in error messages.

Fixes #2453

R=rsc
CC=golang-dev
https://golang.org/cl/5483088
2011-12-15 10:14:57 -08:00
Brad Fitzpatrick
f89b5746fb json: some tests to demonstrate bad error messages
Not a fix yet (help wanted), but part of Issue 2331

R=rsc
CC=golang-dev
https://golang.org/cl/5490043
2011-12-15 10:02:47 -08:00
Russ Cox
1b82e03a8f os: make compatible with go/build
It is probably a mistake to have these here at all -
os is supposed to be portable - but this only fixes
the build issue.

R=golang-dev, r, r, iant
CC=golang-dev
https://golang.org/cl/5487073
2011-12-15 12:33:36 -05:00
Christopher Nielsen
d10126a622 os: OS-dependent bits to support NetBSD.
R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5482068
2011-12-15 12:19:19 -05:00
Roger Peppe
cebf55dc9b time: new AddDate method
R=rsc
CC=golang-dev
https://golang.org/cl/5465044
2011-12-15 11:23:01 -05:00
Dave Cheney
fc6df2fdd8 exp/ssh: rename ClientAuthPublicKey helper ClientAuthKeyring
Also, rename ServerConfig.PubKeyCallback to PublicKeyCallback.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5477059
2011-12-15 11:06:10 -05:00
Rob Pike
24e9683ae6 fmt: don't recur if String method (etc.) misbehaves
Fixes #2555.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5486076
2011-12-14 16:37:54 -08:00
Andrew Balholm
85fdd68bd9 html: don't leave "in column group" mode when ignoring a token
Pass tests6.dat, test 26:
foo<col>

| <col>

Also pass tests through test 35:
<table><tr><div><td>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5482074
2011-12-15 10:45:19 +11:00
Vadim Vygonets
8fbeb945db gzip: Convert between Latin-1 and Unicode
I realize I didn't send the tests in last time.  Anyway, I added
a test that knows too much about the package's internal structure,
and I'm not sure whether it's the right thing to do.

Vadik.

R=bradfitz, rsc, go.peter.90
CC=golang-dev
https://golang.org/cl/5450073
2011-12-14 17:17:40 -05:00
Vadim Vygonets
58b97a29fd net/smtp: add CRAM-MD5 authentication
R=golang-dev, edsrzf, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5451087
2011-12-14 17:17:25 -05:00
Rob Pike
1402d1a686 html/template: define the FuncMap type locally
This redefinition means that the public signature of html/template
does not refer to text/template.

Fixes #2546.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5487083
2011-12-14 11:22:17 -08:00
Brad Fitzpatrick
22dafc9bc5 http: fix failing Transport HEAD request with gzip-looking response
We only want to attempt to un-gzip if there's a body (not in
response to a HEAD)

This was accidentally passing before, but revealed to be broken
when c3c6e72d7cc went in.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5477093
2011-12-14 11:20:21 -08:00
Robert Griesemer
6890afd9a3 strconv: slightly faster int conversion for GOARCH=386
benchmark                           old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatInt         12198        12031   -1.37%
strconv_test.BenchmarkAppendInt          9268         9153   -1.24%
strconv_test.BenchmarkFormatUint         3538         3429   -3.08%
strconv_test.BenchmarkAppendUint         3133         3062   -2.27%

No performance difference for GOARCH=amd64.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5488089
2011-12-14 11:14:10 -08:00
Rob Pike
34c7765fe5 json: treat renamed byte slices the same as []byte
Fixes #2163.

R=rsc
CC=golang-dev
https://golang.org/cl/5488068
2011-12-14 11:03:28 -08:00
Robert Griesemer
465aba66c1 strconv: even faster int conversion
benchmark                           old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatInt         10038         8217  -18.14%
strconv_test.BenchmarkAppendInt          6822         4969  -27.16%
strconv_test.BenchmarkFormatUint         2811         1814  -35.47%
strconv_test.BenchmarkAppendUint         2349         1360  -42.10%

R=rsc
CC=golang-dev
https://golang.org/cl/5488083
2011-12-14 10:45:59 -08:00
Robert Griesemer
25e94154b7 undo CL 5477092 / c3c6e72d7cc5
The obvious fix is breaking the build in non-obvious ways.
Reverting while waiting for the correct fix, if any is needed.

««« original CL description
net/http: fix bug in error checking

Thanks to josef86@gmail.com for pointing this out.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5477092
»»»

R=iant
CC=golang-dev
https://golang.org/cl/5488085
2011-12-14 10:44:34 -08:00
Robert Griesemer
c0421d92c8 net/http: fix bug in error checking
Thanks to josef86@gmail.com for pointing this out.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5477092
2011-12-14 08:43:42 -08:00
Russ Cox
d842acd57e crypto/tls: make compatible with go/build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5484073
2011-12-14 10:25:48 -05:00
Russ Cox
23cd406496 hash/crc32: make compatible with go/build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5486060
2011-12-14 10:25:16 -05:00
Russ Cox
576311d72b go/build: make compatible with go/build
The irony!

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5482062
2011-12-14 10:24:17 -05:00