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

5837 Commits

Author SHA1 Message Date
Russ Cox
0af08d8253 log: fix doc comment for Ldate
Fixes #3303.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5795062
2012-03-12 16:29:33 -04:00
Brad Fitzpatrick
4edd53e47b os: document FileInfo.Size as system-dependent for irregular files
R=rsc, r
CC=golang-dev
https://golang.org/cl/5795059
2012-03-12 13:17:48 -07:00
Russ Cox
b23691148f runtime: print error on receipt of signal on non-Go thread
It's the best we can do before Go 1.

For issue 3250; not a fix but at least less mysterious.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5797068
2012-03-12 15:55:18 -04:00
Russ Cox
4084f08401 html/template: doc nit
Execute's data is untrusted regardless of package.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5797062
2012-03-12 14:26:10 -04:00
Brad Fitzpatrick
e8deb3f828 net/http: return appropriate errors from ReadRequest
Fixes #3298

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5783080
2012-03-12 10:42:25 -07:00
David Symonds
d75abb7ca3 archive/tar: catch short writes.
Also make error messages consistent throughout.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5777064
2012-03-12 17:33:35 +11:00
Robert Hencke
663a7716a1 crypto/tls, fmt: print fixes
R=golang-dev, bradfitz, minux.ma, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5787069
2012-03-12 12:04:45 +09:00
Gwenael Treguier
c3954dd5da database/sql: ensure Stmts are correctly closed.
To make sure that there is no resource leak,
I suggest to fix the 'fakedb' driver such as it fails when any
Stmt is not closed.
First, add a check in fakeConn.Close().
Then, fix all missing Stmt.Close()/Rows.Close().
I am not sure that the strategy choose in fakeConn.Prepare/prepare* is ok.
The weak point in this patch is the change in Tx.Query:
  - Tests pass without this change,
  - I found it by manually analyzing the code,
  - I just try to make Tx.Query look like DB.Query.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5759050
2012-03-10 15:21:44 -08:00
Brad Fitzpatrick
3297fc63d6 database/sql: fix double connection free on Stmt.Query error
In a transaction, on a Stmt.Query error, it was possible for a
connection to be added to a db's freelist twice. Should use
the local releaseConn function instead.

Thanks to Gwenael Treguier for the failing test.

Also in this CL: propagate driver errors through releaseConn
into *DB.putConn, which conditionally ignores the freelist
addition if the driver signaled ErrBadConn, introduced in a
previous CL.

R=golang-dev, gary.burd
CC=golang-dev
https://golang.org/cl/5798049
2012-03-10 10:00:02 -08:00
David Symonds
81a38fbb77 net/mail: close minor TODO that was waiting on a 6g bug fix.
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5796050
2012-03-10 19:02:52 +11:00
Brad Fitzpatrick
b2e9f425b9 net/http: fix crash with Transport.CloseIdleConnections
Thanks Michael Lore for the bug report!

Fixes #3266

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5754068
2012-03-09 16:27:32 -08:00
Brad Fitzpatrick
98cfe6770d archive/zip: verify CRC32s in non-streamed files
We should check the CRC32s of files on EOF, even if there's no
data descriptor (in streamed files), as long as there's a non-zero
CRC32 in the file header / TOC.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5794045
2012-03-09 14:45:40 -08:00
Alex Brainman
9fffe45c65 crypto/x509: do not forget to free cert context
R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/5783059
2012-03-10 09:35:56 +11:00
Brad Fitzpatrick
3cea4131df archive/zip: write data descriptor signature for OS X; fix bugs reading it
We now always write the "optional" streaming data descriptor
signature, which turns out to be required for OS X.

Also, handle reading the data descriptor with or without the
signature, per the spec's recommendation. Fix data descriptor
reading bugs found in the process.

Fixes #3252

R=golang-dev, alex.brainman, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/5787062
2012-03-09 14:12:02 -08:00
Robert Griesemer
ece0d0e7d2 go/printer: example for Fprint
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5785057
2012-03-09 13:53:25 -08:00
Robert Griesemer
49d2d98697 go/printer, gofmt: nicer formatting of multi-line returns
This affects corner (test) cases only; gofmt -w src misc
doesn't cause any changes.

- added additional test cases
- removed doIndent parameter from printer.valueSpec
  (was always false)
- gofmt -w src misc causes no changes

Fixes #1207.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5786060
2012-03-09 11:05:50 -08:00
Russ Cox
c9e5600f7d runtime: move runtime.write back to C
It may have to switch stacks, since we are calling
a DLL instead of a system call.

badcallback says where it is, because it is being called
on a Windows stack already.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5782060
2012-03-09 00:10:34 -05:00
Mikio Hara
26fa1c8248 net: fix typo
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5782063
2012-03-09 11:50:38 +09:00
Russ Cox
6a19ae74d4 go/build: add NoGoError
R=dsymonds
CC=golang-dev
https://golang.org/cl/5781063
2012-03-08 17:30:45 -05:00
Russ Cox
8a1b3d5a57 runtime: fix windows build
Implement runtime·write, like on the other systems,
and also runtime·badcallback, in assembly to reduce
stack footprint.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5785055
2012-03-08 15:53:11 -05:00
Russ Cox
36aa7d4d14 runtime: inline calls to notok
When a very low-level system call that should never fail
does fail, we call notok, which crashes the program.
Often, we are then left with only the program counter as
information about the crash, and it is in notok.
Instead, inline calls to notok (it is just one instruction
on most systems) so that the program counter will
tell us which system call is unhappy.

R=golang-dev, gri, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/5792048
2012-03-08 14:03:56 -05:00
Robert Griesemer
56cae1c230 all: gofmt -w -s src misc
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5781058
2012-03-08 10:48:51 -08:00
Brad Fitzpatrick
9fb68a9a0a database/sql{,driver}: add ErrBadConn
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5785043
2012-03-08 10:09:52 -08:00
Russ Cox
9b73238daa cgo, runtime: diagnose callback on non-Go thread
Before:
$ go run x.go
signal 11 (core dumped)
$

After:
$ go run x.go
runtime: cgo callback on thread not created by Go.
signal 11 (core dumped)
$

For issue 3068.
Not a fix, but as much of a fix as we can do before Go 1.

R=golang-dev, rogpeppe, gri
CC=golang-dev
https://golang.org/cl/5781047
2012-03-08 12:12:40 -05:00
Robert Griesemer
9b7b574edc go/parser: use test harness for short tests
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5782044
2012-03-08 08:53:31 -08:00
Mikkel Krautz
3133b14b30 crypto/x509: allow server gated crypto in windows systemVerify
Also factors out some code into functions to make
systemVerify easier to read.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5781054
2012-03-08 11:28:04 -05:00
Russ Cox
e38c5fb23d net: document ReadMsgUnix, WriteMsgUnix
Fixes #3247.

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5784051
2012-03-08 08:36:40 -05:00
Russ Cox
2ee538bc27 time: mention receiver in Unix, UnixNano docs
Fixes #3248.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5784052
2012-03-08 08:32:52 -05:00
Volker Dobler
d7d1b18a5d fmt: minor tweak of package doc to show headings in godoc
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5781052
2012-03-08 22:22:36 +11:00
Alex Brainman
2b8a7adde8 go/build: do not parse .syso files
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5786049
2012-03-08 17:06:53 +11:00
Robert Griesemer
f3c39d8f2b go/parser: avoid endless loop in case of internal error
Factored the error synchronization code into two functions
syncStmt and syncDecl. Because they may return w/o advancing
the scanner, there is potential for endless loops across
multiple parse functions; typically caused by an incorrect
token list in these functions (e.g., adding token.ELSE to
syncStmt will cause the parser to go into an endless loop
for test/syntax/semi7.go without this mechanism). This would
indicate a compiler bug, exposed only in an error situation
for very specific source files. Added a mechanism to force
scanner advance if an endless loop is detected. As a result,
error recovery will be less good in those cases, but the parser
reported a source error already and at least doesn't get stuck.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5784046
2012-03-07 21:28:50 -08:00
Russ Cox
b0996334c1 go/build, cmd/go: add support for .syso files
.syso files are system objects copied directly
into the package archive.

Fixes #1552.

R=alex.brainman, iant, r, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/5778043
2012-03-07 22:03:18 -05:00
Francisco Souza
686d699ec6 io: minor change in io.WriteAt docs.
R=adg, bradfitz
CC=golang-dev
https://golang.org/cl/5787048
2012-03-08 12:49:13 +11:00
Robert Griesemer
5827dd052c go/scanner: better panic diagnostic
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5787045
2012-03-07 16:57:26 -08:00
Alex Brainman
0029b0d207 path/filepath: retrieve real file name in windows EvalSymlinks
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5756049
2012-03-08 10:00:25 +11:00
Dmitriy Vyukov
c8b1f85493 encoding/gob: fix memory corruption
Fixes #3175.

R=golang-dev, iant, rsc, r
CC=golang-dev
https://golang.org/cl/5758069
2012-03-08 08:53:08 +11:00
Russ Cox
b0beeb1501 runtime: fix freebsd crash
FreeBSD, alone among our supported operating systems,
required that usleep not be interrupted.  Don't require that.

Fixes #3217.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5781045
2012-03-07 15:30:54 -05:00
Robert Griesemer
c8981c718b go/parser: better error synchronization
gofmt reports now a single, accurate error for
the test case of issue 3106.

Also: Added test harness for general error
checking and two test cases for now.

Fixes #3106.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5755062
2012-03-07 12:24:20 -08:00
Russ Cox
babbf941c9 net, net/rpc, reflect, time: document concurrency guarantees
Fixes #1599.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5777043
2012-03-07 14:55:09 -05:00
Russ Cox
291636b99b testing: do not print 'no tests' when there are examples
I am not sure why RunTests and RunExamples are
exported, but I assume that because they are we
should not change the signature, so I added an
unexported global shared by Main and RunTests.

Fixes #3237.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5779043
2012-03-07 14:54:31 -05:00
Rémy Oudompheng
3dcedb620c runtime: try extending arena size in 32-bit allocator.
If it didn't reach the limit, we can try extending the arena
before resorting to random memory mappings and praying for the
kernel to be kind.

Fixes #3173.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5725045
2012-03-07 14:21:45 -05:00
Brad Fitzpatrick
0210f4137b io: more docs on WriterAt
Updates #1599

R=golang-dev, gri, rsc
CC=golang-dev
https://golang.org/cl/5774043
2012-03-07 10:54:04 -08:00
Mikkel Krautz
4aab8806e7 deps: allow crypto/x509 to use syscall
Allows the Windows part of CL 5700087 to land.

I had build tested CL 5753060 (which allows
crypto/x509 to use cgo and io/ioutil), and
didn't spot any errors on Windows.

Turns out I was wrong.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5753065
2012-03-07 13:51:05 -05:00
Robert Griesemer
9e8e4a9313 go/parser: better error sync. if commas are missing
This time for sure.
Runs all tests.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5752060
2012-03-07 10:19:32 -08:00
Mikkel Krautz
a324a5ac20 crypto/x509: new home for root fetchers; build chains using Windows API
This moves the various CA root fetchers from crypto/tls into crypto/x509.

The move was brought about by issue 2997. Windows doesn't ship with all
its root certificates, but will instead download them as-needed when using
CryptoAPI for certificate verification.

This CL changes crypto/x509 to verify a certificate using the system root
CAs when VerifyOptions.RootCAs == nil. On Windows, this verification is
now implemented using Windows's CryptoAPI. All other root fetchers are
unchanged, and still use Go's own verification code.

The CL also fixes the hostname matching logic in crypto/tls/tls.go, in
order to be able to test whether hostname mismatches are honored by the
Windows verification code.

The move to crypto/x509 also allows other packages to use the OS-provided
root certificates, instead of hiding them inside the crypto/tls package.

Fixes #2997.

R=agl, golang-dev, alex.brainman, rsc, mikkel
CC=golang-dev
https://golang.org/cl/5700087
2012-03-07 13:12:35 -05:00
Russ Cox
a385f38dfa net: delete usableLocalPort from test
The old way to find a port was to listen :0 and then
look at what port it picked, close the listener, and then
immediately try to listen on that port.

On some Windows 7 machines that sequence fails at
the second listen, because the first one is still lingering
in the TCP/IP stack somewhere.  (Ironically, most of these
are used in tests of a "second listen", which in this case
ends up being the third listen.)

Instead of this race, just return the listener from the
function, replacing usableLocalPort+Listen with
usableListenPort.

Fixes #3219.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5769045
2012-03-07 12:06:22 -05:00
Russ Cox
b37841cc06 runtime/pprof: disable test on Leopard 64-bit
Fixes #3234.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5756078
2012-03-07 11:44:54 -05:00
Mikio Hara
ae7a843471 net: use IANA reserved port to test dial timeout
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5757060
2012-03-07 16:28:40 +09:00
Alex Brainman
5aee1f3a0f exp/wingui: getting relocated to
go get code.google.com/p/gowingui

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/5752067
2012-03-07 17:48:09 +11:00
Mikio Hara
e2b207bc4f sync/atomic: disable store and load test on a single processor machine
Fixes #3226.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5756073
2012-03-07 14:51:20 +09:00
Russ Cox
c804efb5de net: fix TestDialTimeout on windows builder
I don't know what's out there, but something
is answering to 127.0.71.111:80 on our builder,
so use a different port.

Also insert a check that the dial fails, which
would have diagnosed this problem.

Fixes #3016.

R=golang-dev, mikioh.mikioh, r
CC=golang-dev
https://golang.org/cl/5754062
2012-03-07 00:41:24 -05:00
Russ Cox
c10650979f net: disable another external network test
I don't know enough about multicast.
Should this be disabled on all systems, not just Windows?

R=golang-dev
CC=golang-dev
https://golang.org/cl/5754060
2012-03-07 00:02:07 -05:00
Shenghou Ma
881966d2a5 cmd/go, cmd/godoc, net: fix typo
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5757050
2012-03-07 12:41:43 +08:00
Russ Cox
7c7966a426 net: disable use of external listen along with other external network uses
By default the all.bash tests must not ever announce
on an external address.  It's not just an OS X issue.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5753067
2012-03-06 23:35:31 -05:00
Russ Cox
c3f4319a24 misc/cgo: re-enable some tests
The testso directory still needs to be enabled.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5731048
2012-03-06 23:27:30 -05:00
Russ Cox
0bc18811b5 fmt, log: stop using unicode
$ go list -f '{{.ImportPath}} {{.Deps}}' fmt log
fmt [errors io math os reflect runtime strconv sync sync/atomic syscall time unicode/utf8 unsafe]
log [errors fmt io math os reflect runtime strconv sync sync/atomic syscall time unicode/utf8 unsafe]

R=bradfitz, rogpeppe, r, r, rsc
CC=golang-dev
https://golang.org/cl/5753055
2012-03-06 23:27:11 -05:00
Rob Pike
8f61631c74 go/build: delete Makefile
We can write syslist.go by hand.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5757057
2012-03-07 14:10:49 +11:00
Rob Pike
544a72cc86 exp/wingui: remove reference to Make.inc
R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/5757058
2012-03-07 14:06:16 +11:00
Rob Pike
f91326b7b1 strconv: remove dependence on unicode and strings
We need a compact, reasonably efficient IsPrint. That adds about 2K of data,
plus a modest amount of code, but now strconv is a near-leaf package.

R=r, bradfitz, adg, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/5756050
2012-03-07 13:50:31 +11:00
Brad Fitzpatrick
502e29f485 database/sql: add docs about connection state, pooling
Fixes #3223

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5755063
2012-03-06 17:44:47 -08:00
Alex Brainman
7a3c6c950b os: fix SameFile to work for directories on windows
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5756064
2012-03-07 11:01:23 +11:00
Adam Langley
3ea3a7c9a5 deps: allow crypto/x509 cgo and io/ioutil.
In order to land 5700087 (which moves the knowledge of how to get the
root certificates for the system from crypto/tls to crypto/x509), we
need to relax the restrictions on crypto/x509. Afterwards, we can
probably tighten them up in crypto/tls.

R=golang-dev, rsc, krautz
CC=golang-dev
https://golang.org/cl/5753060
2012-03-06 17:18:09 -05:00
Brad Fitzpatrick
48eacd90a8 database/sql: fix typo bug resulting in double-Prepare
Bug reported by Blake Mizerany found while writing
his new Postgres driver.

R=golang-dev, blake.mizerany
CC=golang-dev
https://golang.org/cl/5754057
2012-03-06 14:10:58 -08:00
Rob Pike
aeefe0fa6e path/filepath: disable AbsTest on windows
SameFile has a bug.

R=golang-dev
TBR=rsc
CC=golang-dev
https://golang.org/cl/5754055
2012-03-07 08:14:12 +11:00
Rob Pike
2184137cf3 path/filepath/path_test.go: repair and enable TestAbs
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5759051
2012-03-07 07:54:56 +11:00
Robert Griesemer
39b186da6c go/parser: fix build (temporarily disable recent change)
R=golang-dev
CC=golang-dev
https://golang.org/cl/5752059
2012-03-06 11:23:27 -08:00
Robert Griesemer
67cbe9431f go/parser: better error sync. if commas are missing
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5756045
2012-03-06 11:05:16 -08:00
Adam Langley
4f25e4be02 crypto/tls: make the package description more accurate and less aspirational.
Fixes #3216.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5755056
2012-03-06 12:49:29 -05:00
Shenghou Ma
db80edde7d time: during short test, do not bother tickers take longer than expected
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5752058
2012-03-07 01:10:55 +08:00
Ian Lance Taylor
aabbcda816 runtime: remove unused runtime·signame and runtime·newError
R=golang-dev
CC=golang-dev
https://golang.org/cl/5756044
2012-03-06 09:07:00 -08:00
Rémy Oudompheng
9eda2b9977 net: do not use reflect for DNS messages.
Fixes #3201.

R=bradfitz, bradfitz, rsc
CC=golang-dev, remy
https://golang.org/cl/5753045
2012-03-06 08:02:39 +01:00
Mikio Hara
9442c4429a net: add skip message to test
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5753048
2012-03-06 15:41:17 +09:00
Russ Cox
347cc981f0 cmd/go: add -compiler
go/build: add Context.Compiler

Fixes #3157.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5756047
2012-03-06 00:36:24 -05:00
Russ Cox
e9d5a641d7 strconv: add table-based isPrint
Not used yet for simpler merge.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5756048
2012-03-06 00:36:12 -05:00
Brad Fitzpatrick
9ff00c8fc9 go/build: fix windows and plan9 builds
Bit of a band-aid fix.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5757045
2012-03-05 21:33:44 -08:00
Rob Pike
eab4261946 strconv: remove dependency on bytes
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5759044
2012-03-06 15:25:42 +11:00
Russ Cox
88e86936be go/build: add dependency test
This exercises the Import function but more importantly
gives us a place to write down the policy for dependencies
within the Go tree.  It also forces us to look at the dependencies,
which may lead to adjustments.

Surprises:
 - go/doc imports text/template, for HTMLEscape (could fix)
 - it is impossible to use math/big without fmt (unfixable)
 - it is impossible to use crypto/rand without math/big (unfixable)

R=golang-dev, bradfitz, gri, r
CC=golang-dev
https://golang.org/cl/5732062
2012-03-05 23:13:00 -05:00
Rob Pike
98c1baff6f unicode/utf16: delete dependence on package unicode
In the test, verify the copied constants are correct.
Also put the test into package utf16 rather than utf16_test;
the old location was probably due creating the test from
utf8, but the separation is not needed here.

R=golang-dev, bradfitz, rsc, rsc, r
CC=golang-dev
https://golang.org/cl/5752047
2012-03-06 14:58:08 +11:00
Russ Cox
4e110af169 runtime: add Compiler
R=iant, r, gri
CC=golang-dev
https://golang.org/cl/5720073
2012-03-05 22:28:02 -05:00
Russ Cox
0a6fdcf63b net: silence another epoll print
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5752048
2012-03-05 22:07:22 -05:00
Mikio Hara
195ccd5dac net: fix windows build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5755045
2012-03-06 10:07:08 +09:00
Mikio Hara
d4e1383285 net: improve server and file tests
* Splits into three server tests.
  - TestStreamConnServer for tcp, tcp4, tcp6 and unix networks
  - TestSeqpacketConnServer for unixpacket networks
  - TestDatagramPacketConnServer for udp, udp4, udp6 and unixgram networks
* Adds both PacketConn and Conn test clients to datagram packet conn tests.
* Fixes wildcard listen test cases on dual IP stack platform.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5701066
2012-03-06 09:43:45 +09:00
Rob Pike
d9832987ba unicode/utf8: remove dependence on unicode.
The dependency was there only to pull in two constants.
Now we define them locally and verify equality in the test.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5754046
2012-03-06 11:14:45 +11:00
Ian Lance Taylor
46031400d0 reflect: fix comment spacing
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5757043
2012-03-05 15:51:58 -08:00
David Symonds
63e383cff8 expvar: add locking to String, and use RWMutex properly throughout.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5754043
2012-03-06 09:13:26 +11:00
Rémy Oudompheng
aa1aaee7fd runtime: wait for main goroutine before setting GOMAXPROCS.
Fixes #3182.

R=golang-dev, dvyukov, rsc
CC=golang-dev, remy
https://golang.org/cl/5732057
2012-03-05 16:40:27 -05:00
Brad Fitzpatrick
610b5b2fd8 net: remove all direct fmt and bytes imports
Once dnsMsg stops using reflect, we lose even more
indirect dependencies.

R=rsc
CC=golang-dev
https://golang.org/cl/5751043
2012-03-05 13:36:05 -08:00
Russ Cox
c0a842e57f runtime/debug: fix test when source cannot be found
This happens with GOROOT_FINAL=/somewhere/else

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5727069
2012-03-05 16:13:15 -05:00
Brad Fitzpatrick
7300b43c2b net: remove more use of fmt
Also add a TODO for the broken *dnsMsg String method.

R=golang-dev, rsc, borman
CC=golang-dev
https://golang.org/cl/5720075
2012-03-05 12:20:58 -08:00
Brad Fitzpatrick
82a9294d1b net: don't import bytes or fmt in mac.go
Also add some more MAC tests.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5728065
2012-03-05 11:43:28 -08:00
Shenghou Ma
6e211225d7 syscall: fix mkall.sh, mksyscall_linux.pl, and regen for Linux/ARM
CL 3075041 says ARM is not little-endian, but my test suggests otherwise.
My test program is:

    package main
    import ("fmt"; "syscall"; "os")
    func main() {
       err := syscall.Fallocate(1, 1/*FALLOC_FL_KEEP_SIZE*/, 0, int64(40960));
       fmt.Fprintln(os.Stderr, err)
    }

Without this CL, ./test > testfile will show: file too large; and strace shows:
    fallocate(1, 01, 0, 175921860444160)    = -1 EFBIG (File too large)
With this CL, ./test > testfile will show: <nil>; and strace shows:
    fallocate(1, 01, 0, 40960)              = 0

Quoting rsc:
"[It turns out that] ARM syscall ABI requires 64-bit arguments to use an
(even, odd) register pair, not an (odd, even) pair. Switching to "big-endian"
worked because it ended up using the high 32-bits (always zero in the tests
we had) as the padding word, because the 64-bit argument was the last one,
and because we fill in zeros for the rest of the system call arguments, up to
six. So it happened to work."

I updated mksyscall_linux.pl to accommodate the register pair ABI requirement,
and removed all hand-tweaked syscall routines in favor of the auto-generated
ones. These including: Ftruncate, Truncate, Pread and Pwrite.

Some recent Linux/ARM distributions do not bundle kernel asm headers,
so instead we always get latest asm/unistd.h from git.kernel.org (just like
what we do for FreeBSD).

R=ken, r, rsc, r, dave, iant
CC=golang-dev
https://golang.org/cl/5726051
2012-03-06 03:12:11 +08:00
Brad Fitzpatrick
1042d7d5ef expvar: add missing locking in String methods
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5726062
2012-03-05 11:09:50 -08:00
Paul Borman
1b311776c4 csv: clarify what a negative FieldsPerRecord means
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5729068
2012-03-05 13:34:12 -05:00
Russ Cox
8dbd9d746d encoding/json: document that nil slice encodes as null
Fixes #3189.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5730058
2012-03-05 13:29:22 -05:00
Adam Langley
ed35d5e0fb crypto/x509: enforce path length constraint.
An X.509 path length constrains the number of certificate that may
follow in the chain. This is a little simplistic for a first pass as it
doesn't check self-signed certificates (which don't count towards the
length), but it's conservatively simplistic.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5727057
2012-03-05 12:08:42 -05:00
Adam Langley
52d6ca2f86 crypto/x509: don't include empty additional primes in PKCS#1 private key.
asn1 didn't have an omitempty tag, so the list of additional primes in
an RSA private key was serialised as an empty SEQUENCE, even for
version 1 structures. This tripped up external code that didn't handle
v2.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5729062
2012-03-05 12:04:18 -05:00
Adam Langley
6aed613030 encoding/asn1: handle UTCTime before the year 2000
UTCTime only has a two digit date field and year values from 50 should
be 1950, not 2050.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5729063
2012-03-05 11:31:24 -05:00
Mikio Hara
b5dc8724cb net: make Dial and Listen behavior consistent across over platforms
This CL changes the behavior of Dial and Listen API family.

Previous Dial and Listen allow a combo of "tcp6" and IPv4 or IPv6
IPv4-mapped address as its argument, but it also makes slightly
different behaviors between Linux and other platforms. This CL fixes
such differences across over platforms by tweaking IP-level socket
option IPV6_V6ONLY. Consequently new Dial and Listen API family will
reject arguments consists of "tcp6" and IPv4 or IPv6 IPv4-mapped
address.

This CL also adds a bit clarified unicast listener tests.

Fixes #2581.

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/5677086
2012-03-06 00:13:10 +09:00
Stefan Nilsson
a347fdb035 encoding/binary: improve package comment.
The current package comment doesn't mention varints and
protocol buffers. Also, the first sentence is incomprehensible
without further context as "fixed-size values" is undefined.

R=rsc
CC=golang-dev
https://golang.org/cl/5715048
2012-03-05 10:02:30 -05:00
Volker Dobler
06e18ca5a3 strings: Rename example to match function name.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5729065
2012-03-05 22:19:51 +11:00
Scott Lawrence
30f9c99e3e html/template: fix comment typo
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5730051
2012-03-05 10:58:43 +11:00
Mikio Hara
4d35583661 net: move MAC address parser into distinct file
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5727054
2012-03-05 07:42:07 +09:00
Rob Pike
227a04d771 text/template: one more test case
Missed a case for variadic functions with too few arguments.
The code passes, and with the right error, but might as well record the test case.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5732050
2012-03-04 08:06:26 +11:00
Rob Pike
f1d3ff1660 text/template: clean up function values
The recent addition of automatic function invocation generated
some troublesome ambiguities. Restore the previous behavior
and compensate by providing a "call" builtin to make it easy to
do what the automatic invocation did, but in a clear and explicit
manner.

Fixes #3140.

At least for now.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5720065
2012-03-03 23:14:20 +11:00
Robert Griesemer
6474eda490 go/printer: simpler exprList code, more tests
Except for the tests, this is mostly deleting code:

- removed several exprListModes:
  blankStart: easily done explicitly, and trailing blanks
    are cleaned up by the trimmer post-pass
  blankEnd: never used
  commaSep: all exprLists calls had this set

- added test cases for multi-line returns
(for a later fix of issue 1207)

- no formatting changes

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5672062
2012-03-02 11:16:05 -08:00
Robert Griesemer
de7361bf98 all: more typos
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5720044
2012-03-02 11:15:45 -08:00
Shenghou Ma
a3caf073a5 net: during short test, don't bother timeout longer than expected
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5716053
2012-03-03 00:50:18 +08:00
Alex Brainman
d1bd332a67 os: sleep 5ms after process has exited on windows
Fixes #2866.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5719047
2012-03-02 16:35:42 +11:00
Alex Brainman
c3fbc9a5e8 os: implement UserTime/SystemTime on windows
Fixes #3145.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5721044
2012-03-02 14:47:40 +11:00
Rob Pike
36d9ee4aec os: fix grammar in ProcessState comment
Asymptotic convergence.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5719045
2012-03-02 14:07:26 +11:00
Russ Cox
30db6d41cd os: centralize documentation of Process and ProcessState
Also change Wait to say "exit" instead of "exit or stop".

I notice that Pid is not implemented on all systems.
Should we fix that?

Fixes #3138.

R=golang-dev, alex.brainman, r
CC=golang-dev
https://golang.org/cl/5710056
2012-03-01 21:56:54 -05:00
Russ Cox
d49475e078 go/build: fix build
Presumably something about the very large go/build
doc comment breaks the build constraint parser in
cmd/dist.  I don't feel like debugging C code right now,
so move it into its own file.  If cmd/dist decides doc.go
is not part of the package, it will still build correctly.

R=golang-dev
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5722043
2012-03-01 19:42:39 -05:00
Russ Cox
9316070419 go/build: document GOPATH
Fixes #2332.

R=golang-dev, remyoudompheng, gri, r, r
CC=golang-dev
https://golang.org/cl/5710055
2012-03-01 18:26:53 -05:00
Robert Griesemer
7c6654aa70 all: fixed various typos
(Semi-automatically detected.)

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/5715052
2012-03-01 14:56:05 -08:00
Russ Cox
af95499619 reflect: expand doc for Value.Interface
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5716057
2012-03-01 17:55:47 -05:00
Gustavo Niemeyer
b5d4cffd15 encoding/xml: fix xml test tag usage
No real problem.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5717049
2012-03-01 15:20:13 -03:00
Dmitriy Vyukov
2295554db6 sync: add Once example
R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5715046
2012-03-01 22:16:20 +04:00
Dmitriy Vyukov
986df83e0d sync: remove old WaitGroup example
The docs look awkward - there is a paragraph
"For example:" with a plain text example,
and straight below it a real Example.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5717048
2012-03-01 21:26:08 +04:00
Russ Cox
ebe1664d27 go/build: replace FindTree, ScanDir, Tree, DirInfo with Import, Package
This is an API change, but one I have been promising would
happen when it was clear what the go command needed.

This is basically a complete replacement of what used to be here.

build.Tree is gone.

build.DirInfo is expanded and now called build.Package.

build.FindTree is now build.Import(package, srcDir, build.FindOnly).
The returned *Package contains information that FindTree returned,
but applicable only to a single package.

build.ScanDir is now build.ImportDir.

build.FindTree+build.ScanDir is now build.Import.

The new Import API allows specifying the source directory,
in order to resolve local imports (import "./foo") and also allows
scanning of packages outside of $GOPATH.  They will come back
with less information in the Package, but they will still work.

The old go/build API exposed both too much and too little.
This API is much closer to what the go command needs,
and it works well enough in the other places where it is
used.  Path is gone, so it can no longer be misused.  (Fixes issue 2749.)

This CL updates clients of go/build other than the go command.
The go command changes are in a separate CL, to be submitted
at the same time.

R=golang-dev, r, alex.brainman, adg
CC=golang-dev
https://golang.org/cl/5713043
2012-03-01 12:12:09 -05:00
Russ Cox
a72b87efa9 reflect: make Value.Interface return immutable data
Fixes #3134.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5713049
2012-03-01 11:48:27 -05:00
Russ Cox
dc159fabff runtime: run init on main thread
Fixes #3125.

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/5714049
2012-03-01 11:48:17 -05:00
David Symonds
289a1638aa html/template: encoding/json does more escaping now, so update the html/template test that uses it.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5714052
2012-03-01 17:52:05 +11:00
David Symonds
99e45e49b7 encoding/json: escape output from Marshalers.
Fixes #3127.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5707054
2012-03-01 17:41:59 +11:00
Alex Brainman
ed238ca4e5 os: release process handle at the end of windows (*Process).Wait
Fixes #3154.

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5707052
2012-03-01 17:36:35 +11:00
David Symonds
1f0f459a16 encoding/gob: more hardening for lengths of input strings.
Fixes #3160.

R=r
CC=golang-dev
https://golang.org/cl/5716046
2012-03-01 15:57:54 +11:00
Rob Pike
dd001b5931 text/template: add examples that use multiple templates
Fixes #2742.

R=golang-dev, peterthrun, adg
CC=golang-dev
https://golang.org/cl/5699083
2012-03-01 14:55:18 +11:00
Robert Griesemer
fd5718ce82 go/printer, gofmt: improved comment placement
Applied gofmt -w src misc (no changes).

Fixes #3147.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5710046
2012-02-29 17:25:15 -08:00
Rob Pike
5a5279e128 io: Pipes and ReadAt are safe to use concurrently.
Updates #1599.

R=golang-dev, bradfitz, rsc, r
CC=golang-dev
https://golang.org/cl/5708056
2012-03-01 11:24:13 +11:00
Johan Euphrosine
6652b0b866 doc: add The Laws of Reflection article
Originally published on The Go Programming Language Blog, September 6, 2011.

http://blog.golang.org/2011/09/laws-of-reflection.html

Update #2547

R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/5689054
2012-03-01 10:05:51 +11:00
Mikio Hara
7301065fcc net: make -external flag for tests default to true
go test -short # like in the build; no external stuff
go test # long tests, + external
go test -external=false # long tests, no external

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5696079
2012-03-01 07:39:03 +09:00
Russ Cox
fc268acf05 path/filepath: steer people away from HasPrefix
The strikes against it are:

1. It does not take path boundaries into account.
2. It assumes that Windows==case-insensitive file system
and non-Windows==case-sensitive file system, neither of
which is always true.
3. Comparing ToLower against ToLower is not a correct
implementation of a case-insensitive string comparison.
4. If it returns true on Windows you still don't know how long
the matching prefix is in bytes, so you can't compute what
the suffix is.

R=golang-dev, r, dsymonds, r
CC=golang-dev
https://golang.org/cl/5712045
2012-02-29 16:37:40 -05:00
Brad Fitzpatrick
8c5290502f time: skip a often-flaky test in short mode
In -test.short mode, skip measuring the upper bound of time
sleeps. The API only guarantees minimum bounds on sleeps,
anyway, so this isn't a bug we're ignoring as much as it is
simply observing bad builder virtualization and/or loaded
machines.

We keep the test in full mode where developers will
presumably be running on a lightly-loaded, native, fast
machine.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5713044
2012-02-29 13:14:05 -08:00
Russ Cox
7aba72baaa os: diagnose chdir error during StartProcess
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5711044
2012-02-29 15:53:57 -05:00
Russ Cox
b47cef394b path/filepath: note that SplitList is different from strings.Split
R=golang-dev, r, bradfitz, gustavo
CC=golang-dev
https://golang.org/cl/5712044
2012-02-29 15:50:46 -05:00
Brad Fitzpatrick
8f0bfc5a29 net/http/httptest: make Server.Close wait for outstanding requests to finish
Might fix issue 3050

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5708066
2012-02-29 12:18:26 -08:00
Shenghou Ma
357b257cd1 runtime/pprof: skip test on 64-bit Mac OS X 10.6
R=rsc, bsiegert
CC=golang-dev
https://golang.org/cl/5709060
2012-03-01 03:11:37 +08:00
Brad Fitzpatrick
3684ae9da0 net/http: make a test more paranoid & reliable on Windows, maybe.
Part of diagnosing issue 3050.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5707056
2012-02-29 09:53:20 -08:00
Brad Fitzpatrick
f5df930618 net/http: fix ProxyFromEnvironment bug, docs, add tests
Fixes #2919 I believe. (gets as far as sending a CONNECT
request to my little dummy logging proxy that doesn't actually
support CONNECT now.)  Untested with a real CONNECT-supporting
proxy, though.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5708055
2012-02-29 09:52:52 -08:00
Brad Fitzpatrick
02b124e59a net/http/httputil: make https DumpRequestOut less racy
It's still racy in that it mutates req.Body, though.  *shrug*

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5709054
2012-02-29 09:52:28 -08:00
Robert Hencke
fc79058199 gob: trivial print fix
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5707062
2012-02-29 08:45:57 -08:00
Robert Griesemer
b1b0ed1e60 go/printer: replace multiline logic
This CL mostly deletes code.

Using existing position information is
just as good to determine if a new section
is needed; no need to track exact multi-
line information. Eliminates the need to
carry around a multiLine parameter with
practically every function.

Applied gofmt -w src misc resulting in only
a minor change to godoc.go. In return, a couple
of test cases are now formatted better.

Not Go1-required, but nice-to-have as it will
simplify fixes going forward.

R=rsc
CC=golang-dev
https://golang.org/cl/5706055
2012-02-29 08:38:31 -08:00
Luuk van Dijk
fb2706113f pkg/runtime: 2 sanity checks in the runtime-gdb.py prettyprinters.
Don't try to print obviously corrupt slices or interfaces.
Doesn't actually solve 3047 or 2818, but seems a good idea anyway.

R=rsc, bsiegert
CC=golang-dev
https://golang.org/cl/5708061
2012-02-29 16:42:25 +01:00
Mikio Hara
ecdd9f2376 net: minor fixes to test
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5707058
2012-02-29 12:34:05 +09:00
Rob Pike
ee149d9a6b io: document that i/o is not necessarily safe for parallel access.
Updates #1599.

R=golang-dev, adg, dsymonds
CC=golang-dev
https://golang.org/cl/5704052
2012-02-29 13:30:08 +11:00
Brad Fitzpatrick
1b1039a1c1 net/http/httputil: fix DumpRequestOut on https URLs
Don't try to do an SSL negotiation with a *bytes.Buffer.

Fixes #3135

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5709050
2012-02-28 16:03:32 -08:00
Mikio Hara
e266d6064c net: fix comment on Dial with unixgram
We should use DialUnix or ListenPacket for unixgram networks
because Dial doesn't take a local UnixAddr.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5706043
2012-02-29 07:45:38 +09:00
Russ Cox
38a03de6a1 go/build: move code around
Only copy+paste here.
Will make next code review's diffs a bit smaller.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5704050
2012-02-28 16:34:41 -05:00
Russ Cox
6e2ae0a12c runtime/pprof: support OS X CPU profiling
Work around profiling kernel bug with signal masks.
Still broken on 64-bit Snow Leopard kernel,
but I think we can ignore that one and let people
upgrade to Lion.

Add new trivial tools addr2line and objdump to take
the place of the GNU tools of the same name, since
those are not installed on OS X.

Adapt pprof to invoke 'go tool addr2line' and
'go tool objdump' if the system tools do not exist.

Clean up disassembly of base register on amd64.

Fixes #2008.

R=golang-dev, bradfitz, mikioh.mikioh, r, iant
CC=golang-dev
https://golang.org/cl/5697066
2012-02-28 16:18:24 -05:00
Rémy Oudompheng
c10f50859e all: remove various unused unexported functions and constants.
R=golang-dev, minux.ma, rsc
CC=golang-dev, remy
https://golang.org/cl/5702050
2012-02-28 21:48:03 +01:00
Rob Pike
250fa82122 net/rpc: API changes, all documentation
except for hiding one type that is only used internally.

Fixes #2944.

R=golang-dev, rsc, kevlar
CC=golang-dev
https://golang.org/cl/5707044
2012-02-29 07:34:28 +11:00
Mikkel Krautz
fb1a5fcacf crypto/tls: force OS X target version to 10.6 for API compatibility
This is a band-aid until we can use weak imports with cgo.

Fixes #3131.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5700083
2012-02-28 11:34:48 -05:00
Shenghou Ma
e0aa36147d encoding/gob: fix "// +build" comment for debug.go
R=golang-dev, rsc, adg, r, r
CC=golang-dev
https://golang.org/cl/5693060
2012-02-28 13:39:42 +08:00
Robert Griesemer
e952e241ae gotype: provide -comments flag
When debugging ASTs, it's useful to also
see the comments on occasion. Usage:

gotype -ast -comments file.go

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5703043
2012-02-27 21:35:26 -08:00
Rob Pike
26c2443d80 text/template: add example showing use of custom function
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5694100
2012-02-28 15:50:41 +11:00
Rob Pike
180541b2b1 text/template: fix redefinition bugs
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5696087
2012-02-28 14:23:57 +11:00
Mikio Hara
d9c5626047 net: no panic on placeholders for netbsd
Perhaps it might be better than panic.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5701064
2012-02-28 10:58:01 +09:00
David Symonds
9dd746c4cb encoding/json: drop MarshalForHTML; gofix calls to Marshal.
I've elected to omit escaping the output of Marshalers for now.
I haven't thought through the implications of that;
I suspect that double escaping might be the undoing of that idea.

Fixes #3127.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5694098
2012-02-28 11:41:16 +11:00
Benny Siegert
740d503866 net: add stubs for NetBSD
This fixes the build of package net for GOOS=NetBSD.
Of course, a real implementation would be even better.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5693065
2012-02-28 11:28:10 +11:00
Benny Siegert
8c7b832ad5 os: fix NetBSD build
os.fileStat.Sys is no longer exported.

R=golang-dev, m4dh4tt3r, r
CC=golang-dev
https://golang.org/cl/5696074
2012-02-28 11:26:01 +11:00
Brad Fitzpatrick
fa33fdbc7d encoding/binary: better example
leave that joke to Java.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5695080
2012-02-28 10:15:23 +11:00
Andrew Gerrand
ce51e10749 archive/zip: use encoding/binary again, add readBuf helper
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5699097
2012-02-28 09:41:30 +11:00
Anthony Martin
eafe86c2df go/printer: fix printing of variadic function calls
Fixes #3130.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5697062
2012-02-27 13:56:43 -08:00
Rob Pike
ec15046a8d cmd/go: drop -example, apply -run to examples
Once more, with feeling.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5698080
2012-02-28 08:33:06 +11:00
Robert Griesemer
b495e5c538 strings: make Count example show results
Thanks to dr.volker.dobler for tracking this down.

Filed a long-term issue (3142) which may eventually
resolve this problem w/o the need for a manual fix.

R=iant
CC=golang-dev
https://golang.org/cl/5698078
2012-02-27 12:22:10 -08:00
Anthony Martin
0706d00cb8 go/printer: fix test for new import path restrictions
Import paths with spaces are now invalid.

The builders would've caught this if they were running
the long tests.  I've removed the check for short tests
in this package since the current tests are fast enough
already.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5694082
2012-02-27 10:01:45 -08:00
Andrew Gerrand
eb825b58cc archive/zip: use smarter putUintXX functions to hide offsets
R=bradfitz, r, dsymonds, kyle
CC=golang-dev
https://golang.org/cl/5701055
2012-02-27 17:37:59 +11:00
Andrew Gerrand
228f44a1f5 archive/zip: stop using encoding/binary
R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5694085
2012-02-27 16:29:22 +11:00
Rob Pike
28668c3a28 cmd/go: run examples even if -run is set if -example is also set
Allows one to disable everything but the example being debugged.
This time for sure.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5700079
2012-02-27 16:23:22 +11:00
Rob Pike
5876b4eb28 testing: add -test.example flag to control execution of examples
Also, don't run examples if -test.run is set.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5697069
2012-02-27 12:49:10 +11:00
Alex Brainman
c7482b9196 os: implement sameFile on windows
Fixes #2511.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5687072
2012-02-27 12:29:33 +11:00
Mikkel Krautz
e4db4e9b58 crypto/x509: fix typo in Verify documentation
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5695070
2012-02-27 11:49:06 +11:00
Mike Rosset
4762e9d98c html/template: use correct method signature, in introduction example.
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5695067
2012-02-27 11:31:38 +11:00
Brad Fitzpatrick
761f946617 net/http/cgi: add an empty response test
New test for http://code.google.com/p/go/source/detail?r=a73ba18

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5701046
2012-02-26 14:46:22 -08:00
Rob Pike
d781603931 time: add a comment about how to use the Duration constants
R=golang-dev, bradfitz, r, dsymonds
CC=golang-dev
https://golang.org/cl/5696078
2012-02-26 22:24:51 +11:00
Robert Griesemer
34e60a81d5 go/ast: examples for ast.Print, ast.Inspect
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5700057
2012-02-24 13:44:36 -08:00
Robert Griesemer
0a33b703e6 go/doc, godoc: fix range of type declarations
For grouped type declarations, go/doc introduces
fake individual declarations. Don't use the original
location of the "type" keyword because it will lead
to an overly large source code range for that fake
declaration, and thus an overly large selection shown
via godoc (e.g.: click on the AssignStmt link for:
http://golang.org/pkg/go/ast/#AssignStmt ).

Also: Don't create a fake declaration if not needed.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694061
2012-02-24 13:44:22 -08:00
Russ Cox
102274a30e runtime: size arena to fit in virtual address space limit
For Brad.
Now FreeBSD/386 binaries run on nearlyfreespeech.net.

Fixes #2302.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5700060
2012-02-24 15:28:51 -05:00
Russ Cox
d8ccebfffa net/http/cgi: fix empty response
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5693058
2012-02-24 15:10:46 -05:00
Gustavo Niemeyer
490c3d4a42 encoding/xml: fix anonymous field Unmarshal example
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5697043
2012-02-24 14:45:32 -05:00
Sanjay Menakuru
27e07a2666 os: fix minor typo
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5697051
2012-02-24 22:42:16 +11:00
Rob Pike
3a1c226a38 reflect.DeepEqual: don't panic comparing functions
Functions are equal iff they are both nil.

Fixes #3122.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5693057
2012-02-24 16:25:39 +11:00
Russ Cox
51a84bbfaa runtime: fix arm
signal.test binary passes on my phone; should fix builder

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5694064
2012-02-23 23:10:38 -05:00
Russ Cox
91bdbf591f net/rpc: silence read error on closing connection
Fixes #3113.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5698056
2012-02-23 22:45:44 -05:00
Mikio Hara
705ebf1144 net: reorganize test files
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694063
2012-02-24 11:58:30 +09:00
David Symonds
5fb82d8cf6 net/http: add overlooked 418 status code, per RFC 2324.
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5688067
2012-02-24 11:55:31 +11:00
Scott Lawrence
c05c3a9d11 html/template: make doctype check case-insensitive
Fixes #3094.

R=golang-dev, rsc, nigeltao
CC=golang-dev
https://golang.org/cl/5687065
2012-02-24 11:32:33 +11:00
Shenghou Ma
1bddfb5203 runtime: check for ARM syscall failures
While we are at it, also update some comments.
    Tested on Linux/ARM builder.

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5696047
2012-02-23 15:43:14 -05:00
Stefan Nilsson
83b5f067e8 binary: remove unnecessary dummy type.
R=rsc
CC=golang-dev
https://golang.org/cl/5698052
2012-02-23 15:29:17 -05:00
Russ Cox
3a6a1f9e7e go/parser: expand test cases for bad import
R=gri
CC=golang-dev
https://golang.org/cl/5697047
2012-02-23 14:44:53 -05:00
Russ Cox
224f05ba88 runtime: darwin signal masking
Fixes #3101 (darwin).

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5693044
2012-02-23 14:44:06 -05:00
Russ Cox
240b1d5b44 runtime: linux signal masking
Fixes #3101 (Linux).

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/5696043
2012-02-23 14:43:58 -05:00
Robert Griesemer
28e0e18863 math: slightly more readable comments
Replaced /*-style comments with line comments;
there are two many *'s already in those lines.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5699051
2012-02-23 10:17:24 -08:00
Robert Griesemer
3391de8df7 exp/types: fix package comment
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5695046
2012-02-22 23:40:28 -08:00
Robert Griesemer
bcc3862565 go/parser: check import path restrictions
Replaces pending CL 5674097.
Thanks to ality@pbrane.org for spearheading
the effort.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5683077
2012-02-22 23:21:56 -08:00
Brad Fitzpatrick
a5b5964524 net/http: some more cookie tests
Including a commented-out test we might
tackle later, after seeing what browsers do.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5694045
2012-02-23 15:51:53 +11:00
Gustavo Niemeyer
6c20f5c013 encoding/xml: add example and docs for anon fields
Anonymous pointer fields is not yet supported.
The problem is documented in issue 3108.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694043
2012-02-23 01:35:50 -02:00
Mikio Hara
adbadf444d net: add a bit clarified multicast listener tests
Also adds -external flag to allow use of external networks on tests.

R=rsc
CC=golang-dev
https://golang.org/cl/5693043
2012-02-23 12:16:43 +09:00
Russ Cox
ebae73bb24 pprof: add Profile type
Makes it possible for client code to maintain its own profiles,
and also reduces the API surface by giving us a type that
models built-in profiles.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5684056
2012-02-22 21:46:12 -05:00
Russ Cox
e4b02bfdc0 runtime: goroutine profile, stack dumps
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5687076
2012-02-22 21:45:01 -05:00
Gustavo Niemeyer
133c6bf77f encoding/xml: move Unmarshal example to function
This also fixes MarshalIndent's example after the
recent formatting convention changes.

Fixes #2831.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5671062
2012-02-22 23:37:57 -02:00