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

5439 Commits

Author SHA1 Message Date
Brad Fitzpatrick
5d198bf866 os/exec: add Cmd.Waitmsg, fix a misleading comment
Fixes #2948

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5655048
2012-02-10 14:52:08 +11:00
Rob Pike
4c7695126d strings: delete method comments implied by interface satisfaction
Fixes #2957.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5653053
2012-02-10 14:45:11 +11:00
Rob Pike
3f1cff3951 testing/quick: documentation tweaks
Fixes #2960.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5652055
2012-02-10 14:37:50 +11:00
Rob Pike
1308f7c94f testing/iotest: adjust adverbial imprecision in package comment
Fixes #2959.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5651053
2012-02-10 14:37:20 +11:00
Rob Pike
cbd6c34131 testing/script: delete
Dead code.

Fixes #2961.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5650053
2012-02-10 14:31:08 +11:00
Rob Pike
989e611a7b unicode: various documentation tweaks
The comment on IsOneOf regarding Latin-1 was an implementation detail:
when the function is called internally, that condition is true. It used to matter,
but now the comment is a dreg. The function works fine if the character is
Latin-1, so we just delete the comment.

Fixes #2966.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5655047
2012-02-10 14:30:44 +11:00
Rob Pike
0357af80b4 template: refer HTML users to html/template
Fixes #2963.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650051
2012-02-10 14:21:36 +11:00
Brad Fitzpatrick
4152b43457 os: delete Exec, NewFile takes uintptr, rename ShellExpand, doc fixes
Delete O_NDELAY, O_NONBLOCK, O_NOCTTY, O_ASYNC.

Clean up some docs.

Rename ShellExpand -> ExpandEnv.

Make NewFile take a uintptr; change File.Fd to return one.
(for API compatibility between Unix and Windows)

Fixes #2947

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5655045
2012-02-10 14:16:15 +11:00
Rob Pike
6c0aa2f296 unicode/utf8: document return value for decode errors
Also replace archaic definition of rune.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5654048
2012-02-10 14:12:17 +11:00
Rob Pike
1bfffb67d8 time: improve commentary about standard time and formatting/parsing
Fixes #2965.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5652054
2012-02-10 13:52:19 +11:00
Rob Pike
7ef97def80 testing: fix references to "gotest"
Fixes #2958.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5650050
2012-02-10 13:49:50 +11:00
Brad Fitzpatrick
7750fc894a os: remove Time; callers should use time.Time.
Part of issue 2947

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5651051
2012-02-10 11:44:51 +11:00
Brad Fitzpatrick
0a398c4057 net/http/fcgi: don't mention threads in docs
Fixes #2942

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5650049
2012-02-10 10:29:57 +11:00
Robert Griesemer
88a9e76e28 text/scanner: update comments
Fixes #2962.

R=rsc
CC=golang-dev
https://golang.org/cl/5652048
2012-02-09 15:26:08 -08:00
Brad Fitzpatrick
9cd4a0467a regexp: name result parameters referenced from docs
Fixes #2953

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5653051
2012-02-10 10:22:01 +11:00
Brad Fitzpatrick
6bdd791dec database/sql: remove Into from ScannerInto/ScanInto
Also fix a doc error.

Fixes #2843

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5653050
2012-02-10 10:20:49 +11:00
Rob Pike
44fa114dc6 container/heap: add example
godoc doesn't have the fu to present the example well, but this gives
us an example of an example to develop example fu.

Fixes #2840.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5645063
2012-02-10 10:07:55 +11:00
Brad Fitzpatrick
4539d1f307 net/http: add ServeContent
Fixes #2039

R=r, rsc, n13m3y3r, r, rogpeppe
CC=golang-dev
https://golang.org/cl/5643067
2012-02-10 10:02:06 +11:00
Rob Pike
59dc21584a encoding/binary: another attempt to describe the type of Read and Write's data
R=golang-dev, rsc, gri, r
CC=golang-dev
https://golang.org/cl/5641062
2012-02-10 09:55:48 +11:00
Rob Pike
eb02b9cf9c encoding/hex: vet the test prints
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5642075
2012-02-10 09:44:56 +11:00
Alex Brainman
309863aec4 compress/gzip: remove dead code
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5645074
2012-02-10 09:33:51 +11:00
Andrew Balholm
aca4a6c933 database/sql: support ErrSkip in Tx.Exec
If the database driver supports the Execer interface but returns
ErrSkip, calling Exec on a transaction was returning the error instead
of using the slow path.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5654044
2012-02-10 09:19:22 +11:00
Brad Fitzpatrick
00651a2e63 database/sql: rename ErrTransactionFinished to ErrTxDone
Part of issue 2843

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5646063
2012-02-10 09:12:32 +11:00
Shenghou Ma
bb40196ebf runtime: Linux/ARM: exit early on OABI systems, and give an error message
Fixes #2533.

R=rsc
CC=golang-dev
https://golang.org/cl/5654045
2012-02-09 16:18:21 -05:00
Brad Fitzpatrick
396170da9b strings: add Seek method to Reader
strings.Reader is already stateful and read-only.

This permits a *Reader with http.ServeContent.

R=golang-dev, r, rsc, rsc
CC=golang-dev
https://golang.org/cl/5639068
2012-02-09 17:28:41 +11:00
Rob Pike
be0f6febad os: talk about errors and PathError in the package documentation
Fixes #2383.

R=golang-dev, bradfitz, adg, rsc
CC=golang-dev
https://golang.org/cl/5641061
2012-02-09 16:55:36 +11:00
Russ Cox
1253c75cf5 runtime: fix compiler warnings
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5642068
2012-02-09 16:48:52 +11:00
Brad Fitzpatrick
ce57ba9fee net/http/httptest: add a test
Less ironic. Don't you think?

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5643069
2012-02-09 16:45:24 +11:00
Brad Fitzpatrick
29df93735c database/sql: more tests
Higher level tests for the pointer parameters
and scanning, complementing the existing ones
included in the previous CL.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5646050
2012-02-09 15:01:29 +11:00
Rob Pike
1c1ecd7473 log/syslog: fix documentation for NewLogger
Fixes #2798.

R=golang-dev, bradfitz, r, rsc, rsc
CC=golang-dev
https://golang.org/cl/5642071
2012-02-09 14:40:56 +11:00
Rob Pike
c0e74b63cf fmt: scan FALSE correctly
Fixes bug 2922.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5642072
2012-02-09 14:12:55 +11:00
Brad Fitzpatrick
3484d5462d net/http: remove an errant space
Made the godoc overview section oddly indented
compared to the other code blocks.

R=golang-dev, mikioh.mikioh, dsymonds, r
CC=golang-dev
https://golang.org/cl/5645060
2012-02-09 14:10:36 +11:00
Gary Burd
e7bd71c83a go/doc: Handle recursive embedded types.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5645053
2012-02-08 16:54:48 -08:00
Rob Pike
025c9a946d encoding/binary: slices are allowed; say so
Fixes #2629.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5642069
2012-02-09 11:42:10 +11:00
Rob Pike
8c4a2ca83b encoding/binary: add Size, to replace the functionality of the old TotalSize
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5644063
2012-02-09 11:26:03 +11:00
Mikio Hara
d082e5976e text/template/parse: fix comment
R=r, rsc
CC=golang-dev
https://golang.org/cl/5644055
2012-02-09 07:47:48 +09:00
Shenghou Ma
073aeff785 runtime: fix "SysReserve returned unaligned address" bug on 32-bit systems
R=rsc
CC=golang-dev
https://golang.org/cl/5642064
2012-02-09 09:25:10 +11:00
Rob Pike
c59dc485cd bytes.Buffer: return error in WriteTo if buffer is not drained
R=rsc
CC=golang-dev
https://golang.org/cl/5642065
2012-02-09 08:58:40 +11:00
Rob Pike
3fce00d99e log/syslog: return length of data provided by the user, not length of header
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5644059
2012-02-09 08:36:13 +11:00
Robert Griesemer
d08dd8bec1 go/scanner: clean up error interface
Issue 2856 asks for a rename of a few methods to a
more idiomatic Go style. This is a very early API
that evolved organically throughout the years.
Together with the fact that ErrorVectors were embedded
in other data structures (e.g. Parser), just renaming
methods (e.g. GetError -> Error) would lead to undesired
behavior (e.g., Parser would act like an Error). Instead,
cleaned up API a bit more:

- removed ErrorVector in favor of ErrorList (already
present)
- simplified Scanner.Init by making the error handler a
function instead of requiring an ErrorHandler implementation
- adjusted helper functions accordingly
- updated Go 1 doc

Fixes #2856.

R=rsc
CC=golang-dev
https://golang.org/cl/5624047
2012-02-08 11:41:32 -08:00
Paul Borman
d37a8b73c5 runtime: drop to 32 bit malloc if 64 bit will not work
On 64 bit UML it is not possible to reserve memory at 0xF8<<32.
Detect when linux cannot use these high virtual memory addresses
and drop back to the 32 bit memory allocator.

R=rsc, cw
CC=golang-dev
https://golang.org/cl/5634050
2012-02-08 14:39:16 -05:00
Russ Cox
d0dc68901a net/http: panic on duplicate registrations
Otherwise, the registration semantics are
init-order-dependent, which I was trying very hard
to avoid in the API.  This may break broken programs.

Fixes #2900.

R=golang-dev, r, bradfitz, dsymonds, balasanjay, kevlar
CC=golang-dev
https://golang.org/cl/5644051
2012-02-08 13:50:00 -05:00
Russ Cox
49110eaa22 encoding/json: document buffering
Fixes #1955.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5643058
2012-02-08 13:48:03 -05:00
Russ Cox
5b93fc9da6 runtime, pprof: add profiling of thread creation
Same idea as heap profile: how did each thread get created?
Low memory (256 bytes per OS thread), high reward for
programs that suddenly have many threads running.

Fixes #1477.

R=golang-dev, r, dvyukov
CC=golang-dev
https://golang.org/cl/5639059
2012-02-08 10:33:54 -05:00
Russ Cox
5957f914e2 regexp: fix typo
Fixes #2918.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5639062
2012-02-08 08:59:59 -05:00
Andrew Pritchard
cc39bb9068 database/sql: treat pointers as nullable types like encoding/json
- convert from nil pointers to the nil interface{}
- dereference non-nil pointers
- convert from nil interface{}s to nil pointers
- allocate pointers for non-nil interface{}s
- tests for all of the above

R=golang-dev, bradfitz, rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5630052
2012-02-08 17:14:15 +11:00
Russ Cox
7201ba2171 regexp: allow substitutions in Replace, ReplaceString
Add Expand, ExpandString for access to the substitution functionality.

Fixes #2736.

R=r, bradfitz, r, rogpeppe, n13m3y3r
CC=golang-dev
https://golang.org/cl/5638046
2012-02-07 23:46:47 -05:00
Russ Cox
1d8250c8b0 time: clean up MarshalJSON, add RFC3339 method
encoding/xml: handle time.Time as recognized type

The long term plan is to define an interface that time.Time
can implement and that encoding/xml can call, but we are
not going to try to define that interface before Go 1.
Instead, special-case time.Time in package xml, because
it is such a fundamental type, as a stop-gap.
The eventual methods will behave this way.

Fixes #2793.

R=golang-dev, r, r, n13m3y3r
CC=golang-dev
https://golang.org/cl/5634051
2012-02-07 23:37:25 -05:00
Russ Cox
3ee208533e strconv: handle very large inputs
Fixes #2642.

R=remyoudompheng, r, r
CC=golang-dev
https://golang.org/cl/5639052
2012-02-07 23:37:15 -05:00
Russ Cox
00134fe8ef fmt: diagnose invalid verb applied to pointer
Fixes #2851.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5644048
2012-02-07 23:37:05 -05:00
Rob Pike
0bd53d2ce0 runtime/cgo: silence warning on windows
It appears to want a * on an indirect function call (assembly language)

TBR=rsc

R=golang-dev
CC=golang-dev
https://golang.org/cl/5643054
2012-02-08 15:26:36 +11:00
Gustavo Niemeyer
0a7ad329e1 encoding/xml: add support for the omitempty flag
This also changes the behavior of attribute marshalling so
that strings and byte slices are marshalled even if empty.
The omitempty flag may be used to obtain the previous behavior.

Fixes #2899.

R=rsc
CC=golang-dev
https://golang.org/cl/5645050
2012-02-08 01:57:44 -02:00
Andrew Gerrand
0a6e2461e3 archive/zip: tweak API and docs.
Fixes #2835.

R=golang-dev, n13m3y3r, r, bradfitz
CC=golang-dev
https://golang.org/cl/5645051
2012-02-08 14:34:40 +11:00
Rob Pike
90d43ad720 encoding/csv: document ReadAll behavior at EOF
Fixes #2847.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5641050
2012-02-08 14:24:04 +11:00
Brad Fitzpatrick
c02db82b83 net/http: don't ignore some errors in tests
to help debug Issue 2651

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5644049
2012-02-07 19:15:25 -08:00
Rob Pike
52ebadd356 encoding/binary: hide TotalSize
The function has a bizarre signature: it was the only public function there
that exposed the reflect package. Also, its definition is peculiar and hard to
explain. It doesn't merit being exported.

This is an API change but really, it should never have been exported and
it's certain very few programs will depend on it: it's too weird.

Fixes #2846.

R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5639054
2012-02-08 14:09:20 +11:00
Rob Pike
bb7b1a11d5 bufio: drop error return for NewReaderSize and NewWriterSize
It complicates the interface unnecessarily.
Document this in go1.html.
Also update the go/doc Makefile.

Fixes #2836.

R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5642054
2012-02-08 13:07:13 +11:00
Brad Fitzpatrick
518ee115b7 net/http/httputil: preserve query params in reverse proxy
Fixes #2853

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5642056
2012-02-07 18:00:30 -08:00
Rob Pike
92f55949f9 encoding/hex: canonicalize error type names
Also simplify the tests.

Fixes #2849.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5643045
2012-02-08 11:53:32 +11:00
Nigel Tao
5e381d3a9a image: delete the image.Repeated type.
R=r
CC=golang-dev
https://golang.org/cl/5636045
2012-02-08 11:41:47 +11:00
Rob Pike
2f8e5a5f88 io/ioutil: document EOF behavior in ReadFile and ReadAll
Fixes #2862.

R=golang-dev, n13m3y3r, iant
CC=golang-dev
https://golang.org/cl/5646048
2012-02-08 11:40:56 +11:00
Robert Griesemer
3d6b368514 go/printer, gofmt: don't print incorrect programs
Be careful when printing line comments with incorrect
position information. Maintain additional state
impliedSemi: when set, a comment containing a newline
would imply a semicolon and thus placement must be
delayed.

Precompute state information pertaining to the next
comment for faster checks (the printer is marginally
faster now despite additional checks for each comment).

No effect on existing src, misc sources.

Fixes #1505.

R=rsc
CC=golang-dev
https://golang.org/cl/5598054
2012-02-07 15:19:52 -08:00
David Symonds
32ffc62348 flag: describe valid input for Duration flags.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5639046
2012-02-07 17:50:04 +11:00
Rob Pike
9ce23548cb encoding/gob: document CommonType
Also bring the names in doc.go in line with the source.
More radical resolutions are possible but require substantial internal
changes for very little benefit. Fixing it this way lets us keep the
embedding, which has a huge simplifying effect, and guarantees
binary compatibility.

Fixes #2848.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5644045
2012-02-07 16:15:55 +11:00
Rob Pike
749f228cbd encoding/xml: fix documentation for Decoder.Skip
Fixes #2850.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5645043
2012-02-07 16:15:35 +11:00
Rob Pike
38b8f6c7a4 bufio: remove special error type, update docs
Updates #2836.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5639045
2012-02-07 16:15:03 +11:00
Robert Griesemer
668418d122 go/token: remove dependency on encoding/gob
R=dsymonds
CC=golang-dev
https://golang.org/cl/5636053
2012-02-06 17:41:19 -08:00
Alex Brainman
1f133e2b8e net: run TestDialTimeout on windows
R=golang-dev, rsc
CC=bradfitz, golang-dev, mikioh.mikioh
https://golang.org/cl/5616066
2012-02-07 12:05:59 +11:00
Rob Pike
97ef437212 path/filepath: repair and simplify the symlink test
I hate symlinks.
Fixes #2787.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5638043
2012-02-07 11:00:13 +11:00
Russ Cox
32f011e46b syscall: add Timeval.Nano, Timespec.Nano, for conversion to Duration
Fixes #2534.

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/5635051
2012-02-06 18:04:12 -05:00
Russ Cox
ae7497bda6 doc: remove overuse of simply
Specifically, remove simply where it is claiming that the
code or the action to be carried out is simple, since the
reader might disagree.

R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5637048
2012-02-06 13:34:35 -05:00
Russ Cox
fec7fa8b9d build: delete make paraphernalia
As a convenience to people working on the tools,
leave Makefiles that invoke the go dist tool appropriately.
They are not used during the build.

R=golang-dev, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5636050
2012-02-06 13:34:25 -05:00
Rémy Oudompheng
842c906e2e runtime: delete UpdateMemStats, replace with ReadMemStats(&stats).
Unexports runtime.MemStats and rename MemStatsType to MemStats.
The new accessor requires passing a pointer to a user-allocated
MemStats structure.

Fixes #2572.

R=bradfitz, rsc, bradfitz, gustavo
CC=golang-dev, remy
https://golang.org/cl/5616072
2012-02-06 19:16:26 +01:00
Brad Fitzpatrick
9c060b8d60 database/sql: permit scanning into interface{}
See thread http://goo.gl/7zzzU for background.

R=rsc
CC=golang-dev
https://golang.org/cl/5624051
2012-02-06 10:06:22 -08:00
Shenghou Ma
6392b43a15 8a, 8l: implement support for RDTSC instruction.
Also modify runtime/asm_386.s to use it.

R=rsc
CC=golang-dev
https://golang.org/cl/5634043
2012-02-06 12:49:28 -05:00
Russ Cox
facee93a86 runtime: fix float64 hash on 32-bit machine
Multiplying by the low 32 bits was a bad idea
no matter what, but it was a particularly unfortunate
choice because those bits are 0 for small integer values.

Fixes #2883.

R=ken2
CC=golang-dev
https://golang.org/cl/5634047
2012-02-06 11:24:34 -05:00
Russ Cox
48bd13911d runtime: use GOTRACEBACK to decide whether to show runtime frames
Right now, GOTRACEBACK=0 means do not show any stack traces.
Unset means the default behavior (declutter by hiding runtime routines).

This CL makes GOTRACEBACK=2 mean include the runtime routines.
It avoids having to recompile the runtime when you want to see
the runtime in the tracebacks.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5633050
2012-02-06 11:24:14 -05:00
Gustavo Niemeyer
02fb021161 archive/zip: support full range of FileMode flags
Zip files may actually store symlinks, and that's represented
as a file with unix flag S_IFLNK and with its data containing
the symlink target name.

The other flags are being supported too. Now that the os package
has the full range of flags in a system agnostic manner, there's
no reason to discard that information.

R=golang-dev, adg, rogpeppe
CC=golang-dev
https://golang.org/cl/5624048
2012-02-06 11:58:32 -02:00
Patrick Mylund Nielsen
fb86bbe239 net/http: Don't set Content-Type header for HEAD requests by default
since the real type is not inferred.
Fixes #2885.

R=golang-dev, dsymonds, bradfitz
CC=golang-dev
https://golang.org/cl/5633045
2012-02-06 17:55:47 +11:00
Rob Pike
0a75a79cc0 bytes: API tweaks
- fix documentation for NewBuffer and NewBufferString
- document and implement behavior of Truncate on invalid lengths

Fixes #2837.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/5637044
2012-02-06 15:29:21 +11:00
Rob Pike
929203acef io: API tweaks
- eliminate local Error type (a historical artifact)
- fix documentation of CopyN
- fix documentation of WriteString
Fixes #2859.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5636046
2012-02-06 15:09:50 +11:00
Rob Pike
5be24046c7 all: avoid bytes.NewBuffer(nil)
The practice encourages people to think this is the way to
create a bytes.Buffer when new(bytes.Buffer) or
just var buf bytes.Buffer work fine.
(html/token.go was missing the point altogether.)

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5637043
2012-02-06 14:09:00 +11:00
David Symonds
9440d823a5 gob: fuzz testing, plus a fix for very large type names.
Fixes #2689.

R=r
CC=golang-dev
https://golang.org/cl/5616063
2012-02-06 14:02:12 +11:00
David Symonds
cee920225d testing: capture panics, present them, and mark the test as a failure.
R=r
CC=golang-dev
https://golang.org/cl/5633044
2012-02-06 14:00:23 +11:00
Nigel Tao
e066db3acb html: add package doc.
Fixes #2857.

R=r, adg
CC=golang-dev
https://golang.org/cl/5635046
2012-02-06 13:24:45 +11:00
Anthony Martin
b9917045da net: fix Plan 9 build
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5631051
2012-02-05 16:59:32 -08:00
Nigel Tao
8fc87c957c image: add package docs, rename s/UnknownFormatError/ErrFormat/ and
rewrite the doc comment for Repeated.

Fixes #2858.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5626050
2012-02-06 11:04:12 +11:00
David Symonds
ebd9f236de unicode: document large var blocks and the SpecialCase vars.
Fixes #2772.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5631047
2012-02-04 18:35:37 +11:00
Russ Cox
7e5dc928a4 path/filepath: disable broken tests
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5625050
2012-02-04 01:37:30 -05:00
Russ Cox
961f96b5d2 build: delete buildscripts, runtime scripts
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620059
2012-02-04 00:54:26 -05:00
David Symonds
715588f1d3 expvar: revise API.
Nuke RemoveAll from the public API.
Replace Iter functions with Do functions.

Fixes #2852.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5622055
2012-02-04 14:32:05 +11:00
Ian Lance Taylor
ae5c4ea05d reflect: test that PtrTo returns types that match program types
The gccgo compiler was failing this test.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5631046
2012-02-03 17:36:25 -08:00
Robert Griesemer
83bb6ebe9e go/printer: update documentation
Fixes #2855.

R=r
CC=golang-dev
https://golang.org/cl/5608057
2012-02-03 16:57:59 -08:00
Adam Langley
005686ff97 crypto/...: changes to address some of bug 2841.
This change addresses a subset of the issues raised in bug 2841.

R=rsc
CC=golang-dev
https://golang.org/cl/5629044
2012-02-03 15:08:53 -05:00
Rob Pike
1f565e7d20 tools: update references to "x" to be "go tool x"
For instance, don't talk about gofix, talk about the
fix tool or "go tool fix".

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5608053
2012-02-04 07:03:20 +11:00
Brad Fitzpatrick
10f1b6a074 strings: add Fields example
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5629043
2012-02-03 11:17:55 -08:00
Robert Griesemer
d0607221fa math/big: more accurate package comment
Fix some receiver names for consistency.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5624043
2012-02-03 10:17:19 -08:00
Russ Cox
b3750ff52d build: rename $GOROOT/bin/go-tool to $GOROOT/bin/tool.
The go- is redundant now that the directory is required
to be inside $GOROOT.  Rob LGTMed the idea.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5618044
2012-02-02 23:32:41 -05:00
Robert Griesemer
212ba8076e go/doc: don't lose factory functions of non-exported types
Fixes #2824.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5615043
2012-02-02 19:25:29 -08:00
Mikio Hara
44122ed069 syscall: update bootstrap scripts to sync with new go command
R=rsc
CC=golang-dev
https://golang.org/cl/5615054
2012-02-03 12:22:40 +09:00
Robert Griesemer
b80c7e5dfd math/big: API, documentation cleanup
Fixes #2863.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5620058
2012-02-02 19:21:55 -08:00
David Symonds
107b0f12bc encoding/base32: ignore new line characters during decode.
This is the analogue to the encoding/base64 change,
https://golang.org/cl/5610045.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5617056
2012-02-03 13:36:38 +11:00
Gustavo Niemeyer
20f4385af0 os: turn FileStat.Sys into a method on FileInfo
This reduces the overhead necessary to work with OS-specific
file details, hides the implementation of FileStat, and
preserves the implementation-specific nature of Sys.

Expressions such as:

  stat.(*os.FileInfo).Sys.(*syscall.Stat_t).Uid
  fi1.(*os.FileStat).SameFile(fi2.(*os.FileStat))

Are now spelled as::

  stat.Sys().(*syscall.Stat_t).Uid
  os.SameFile(fi1, fi2)

R=cw, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5448079
2012-02-03 00:16:18 -02:00
Gary Burd
b9474de2be go/doc: Fix URL linking in ToHTML.
Fixes issue: 2832

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5616060
2012-02-02 17:02:05 -08:00
David Symonds
cce3de79f6 encoding/base32: add DecodeString and EncodeToString helper methods.
This makes encoding/base32 be consistent with encoding/base64.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5615053
2012-02-03 11:52:04 +11:00
Robert Griesemer
77f11f3ef1 go/scanner: idiomatic receiver names
R=rsc
CC=golang-dev
https://golang.org/cl/5606057
2012-02-02 16:42:29 -08:00
Russ Cox
8fe75a28fb syscall: fix // +build comments in types_*.go
I fixed types_linux.go yesterday but missed the others.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620054
2012-02-02 19:42:02 -05:00
David Symonds
bf89d58e73 encoding/json: call (*T).MarshalJSON for addressable T values.
Fixes #2170.

R=golang-dev, cw, adg
CC=golang-dev
https://golang.org/cl/5618045
2012-02-03 11:15:06 +11:00
Nigel Tao
102638cb53 std: add struct field tags to untagged literals.
R=rsc, dsymonds, bsiegert, rogpeppe
CC=golang-dev
https://golang.org/cl/5619052
2012-02-03 10:12:25 +11:00
Robert Griesemer
25787acb3c math/big: document Word type
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5615050
2012-02-02 14:43:55 -08:00
Mikio Hara
c2331bb77e net: tweak variable declarations
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5617050
2012-02-03 07:40:03 +09:00
Damian Gryski
8e765da941 runtime: add runtime.cputicks() and seed fastrand with it
This patch adds a function to get the current cpu ticks.  This is
deemed to be 'sufficiently random' to use to seed fastrand to mitigate
the algorithmic complexity attacks on the hash table implementation.

On AMD64 we use the RDTSC instruction.  For 386, this instruction,
while valid, is not recognized by 8a so I've inserted the opcode by
hand.  For ARM, this routine is currently stubbed to return a constant
0 value.

Future work: update 8a to recognize RDTSC.

Fixes #2630.

R=rsc
CC=golang-dev
https://golang.org/cl/5606048
2012-02-02 14:09:27 -05:00
Wei Guangjing
16ce2f9369 os: Process.handle use syscall.Handle
R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5605050
2012-02-02 14:08:48 -05:00
Marcel van Lohuizen
8ba20dbdb5 exp/norm: a few minor changes in prepration for a table format change:
- Unified bounary conditions for NFC and NFD and removed some indirections.
   This enforces boundaries at the character level, which is typically what
   the user expects. (NFD allows a boundary between 'a' and '`', for example,
   which may give unexpected results for collation.  The current implementation
   is already stricter than the standard, so nothing much changes.  This change
   just formalizes it.
 - Moved methods of qcflags to runeInfo.
 - Swapped YesC and YesMaybe bits in qcFlags. This is to aid future changes.
 - runeInfo return values use named fields in preperation for struct change.
 - Replaced some left-over uint32s with rune.

R=r
CC=golang-dev
https://golang.org/cl/5607050
2012-02-02 13:55:53 +01:00
Marcel van Lohuizen
d673c95d6c exp/norm: Added some benchmarks for form-specific performance measurements.
R=r
CC=golang-dev
https://golang.org/cl/5605051
2012-02-02 13:19:12 +01:00
Ian Lance Taylor
2b8d5be55f os/exec: make sure file is not closed early in leaked fd test
Without this change, fd3 can be collected by the garbage
collector and finalized, which causes the file descriptor to
be closed, which causes the call to os.Open to return 3 rather
than the expected descriptor number.

R=golang-dev, gri, bradfitz, bradfitz, iant
CC=golang-dev
https://golang.org/cl/5607056
2012-02-01 16:37:02 -08:00
Robert Griesemer
f3f5239d1e all packages: fix various typos
Detected semi-automatically. There are probably more.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620046
2012-02-01 16:19:36 -08:00
Russ Cox
5cc07af675 syscall: fix build directive in types_linux.go
The rule is that build directives can be preceded only
by blank lines and other line comments, not /* */ comments.

R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5619045
2012-02-01 18:25:51 -05:00
Wei Guangjing
4ea5d62e5a os: file windows use syscall.InvalidHandle instead of -1.
R=golang-dev, adg, alex.brainman
CC=golang-dev
https://golang.org/cl/5602050
2012-02-02 10:17:52 +11:00
Brad Fitzpatrick
b2935330b0 net/http/httputil: fix race in DumpRequestOut
Fixes #2715

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5614043
2012-02-01 15:10:14 -08:00
Andrew Gerrand
548206e869 go/printer: remove package comment from testdata/parser.go
This prevents an incorrect summary line from appearing in the godoc
package list.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5607059
2012-02-02 09:28:11 +11:00
David Symonds
b68d947b91 os/signal: move to exp/signal.
Fixes #2816.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5609048
2012-02-02 09:08:50 +11:00
Andrew Gerrand
55779917f3 go/build: put a space between 'generated by make' and package statement
This prevents the message from showing up in godoc.

R=rsc
CC=golang-dev
https://golang.org/cl/5610046
2012-02-02 08:52:22 +11:00
Robert Griesemer
71c19b610f mat/big: add raw access to Int bits
This is a minimal API extension, it makes it possible
to implement missing Int functionality externally w/o
compromising efficiency. It is the hope that this will
reduce the number of feature requests going directly
into the big package.

Also: Fixed some naming inconsistencies: The receiver
is only called z when it is also the result.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/5607055
2012-02-01 11:43:40 -08:00
Luuk van Dijk
8dd3de4d4b pkg/math: undo manual inlining of IsInf and IsNaN
R=rsc
CC=golang-dev
https://golang.org/cl/5484076
2012-02-01 16:08:31 +01:00
David Symonds
2f2b6e55ef encoding/base64: ignore new line characters during decode.
Fixes #2541.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5610045
2012-02-01 19:13:38 +11:00
Mikio Hara
804f1882c5 net, syscall: add IPv4 multicast helpers for windows
Also re-enable simple IPv4 multicast testing on windows.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5605048
2012-02-01 14:14:04 +09:00
Andrew Gerrand
63f68a2eda go/build: update syslist.go package comment
It's no longer generated by make.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5602047
2012-02-01 15:12:24 +11:00
Anthony Martin
1583931bcf syscall: cache environment variables on Plan 9.
This can drastically reduce the number of system
calls made by programs that repeatedly query the
environment.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5599054
2012-01-31 18:14:02 -08:00
Alex Brainman
238af7700e net: fix windows build
Ignore result of setting SO_BROADCAST.

Disable TestSimpleListenMulticastUDP as
setIPv4MulticastInterface is not implemented.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5610044
2012-02-01 12:13:46 +11:00
Robert Griesemer
f7d473dd33 go/doc: added error, rune to list of predeclared types
Don't throw away factory functions returning error or rune.

Fixes #2820.

R=rsc
CC=golang-dev
https://golang.org/cl/5604046
2012-01-31 15:41:25 -08:00
Russ Cox
d7c04517a0 fmt: fix caching bug in Scan
Black box test is too time-consuming, as the bug
does not appear until Scan has processed 2 GB of
input in total across multiple calls, so no test.

Thanks to Frederick Mayle for the diagnosis and fix.

Fixes #2809.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5611043
2012-01-31 18:38:33 -05:00
Brad Fitzpatrick
d3285f2a79 net: remove types InvalidConnError and UnknownSocketError
Both are unused and undocumented.

InvalidConnError is also non-idiomatic: a FooError type can
typically describe something, else it would be an ErrFoo
variable.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5609045
2012-01-31 15:04:42 -08:00
Rémy Oudompheng
e818536500 go: record location of failed imports for error reporting.
Fixes #2664.

R=rsc
CC=golang-dev, remy
https://golang.org/cl/5593047
2012-01-31 23:37:01 +01:00
Brad Fitzpatrick
549ca930a0 net: move DNSConfigError to a portable file
The type being unavailable on Windows was the only API
signature difference in the net package.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5608043
2012-01-31 13:01:34 -08:00
Robert Griesemer
3c6bebf5a7 go/doc: enable AllMethods flag (and fix logic)
- enable AllMethods flag (default: not set)
- fix logic determining which methods to show
- added respective test case in testdata/e.go for AllMethods = false
- added test case set for AllMethods = true

The critical changes/files to look at are:
- testdata/e{0,1,2}.golden: T4.M should only show up as method of T5 in e2.golden
- reader.go: always include top-level methods, and negate former logic for embedded methods
  (rewrote as a switch for better comprehensability)

Fixes #2791.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5576057
2012-01-31 09:48:10 -08:00
Brad Fitzpatrick
c0ecfb072b net/http: close client fd sooner on response read error
This fixes some test noise in TestStressSurpriseServerCloses when
ulimit -n something low, like 256 on a Mac.

Previously, when the server closed on us and we were expecting more
responses (like we are in that test), we'd read an "Unexpected EOF"
and just forget about the client's net.Conn.  Now it's closed,
rather than waiting on the finalizer to release the fd.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5602043
2012-01-31 09:45:13 -08:00
Mikio Hara
847197d339 net: disable normal multicast testing on linux/arm
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5603043
2012-02-01 02:42:56 +09:00
Adam Langley
2cc3351131 crypto/elliptic: p224Contract could produce a non-minimal representation.
I missed an overflow in contract because I suspected that the prime
elimination would take care of it. It didn't, and I forgot to get back
to the overflow. Because of this, p224Contract may have produced a
non-minimal representation, causing flakey failures ~0.02% of the
time.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5592045
2012-01-31 12:27:42 -05:00
Mikio Hara
2f63afdc7a net: ListenMulticastUDP to listen concurrently across multiple listeners
This CL introduces new function ListenMulticastUDP to fix
multicast UDP listening across multiple listeners issue,
to replace old multicast methods JoinGroup and LeaveGroup
on UDPConn.

This CL also enables multicast testing by default.

Fixes #2730.

R=rsc, paul.a.lalonde, fullung, devon.odell
CC=golang-dev
https://golang.org/cl/5562048
2012-02-01 01:53:26 +09:00
Adam Langley
c86e03975c crypto/tls: better error message when connecting to SSLv3 servers.
We support SSLv3 as a server but not as a client (and we don't want to
support it as a client). This change fixes the error message when
connecting to an SSLv3 server since SSLv3 support on the server side
made mutualVersion accept SSLv3.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5545073
2012-01-31 11:22:47 -05:00
Russ Cox
31d908baaf net: fix windows build
TBR=mikioh
CC=golang-dev
https://golang.org/cl/5588048
2012-01-31 11:20:34 -05:00
Adam Langley
8efb304440 crypto/x509: use case-insensitive hostname matching.
Fixes #2792.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5590045
2012-01-31 11:00:16 -05:00
Russ Cox
9a15c2186c build: move goapi, quietgcc, cgo, gotype, ebnflint into go-tool
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5552054
2012-01-31 10:38:07 -05:00
Mikio Hara
28397befab net: replace error variable name e, errno with err
R=rsc, r
CC=golang-dev
https://golang.org/cl/5593046
2012-02-01 00:36:45 +09:00
Joel Sing
1677f1a163 os/exec: TestExtraFiles - close any leaked file descriptors
Ensure that file descriptors have not already been leaked into our
environment - close any that are open at the start of the
TestExtraFiles test.

Also use the appropriate command for listing open files.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5574062
2012-01-31 22:09:06 +11:00
Damian Gryski
85aeeadaec runtime: use per-map hash seeds
This patch adds a hash seed to the Hmap struct.  Each seed is
initialized by runtime.fastrand1().  This is the first step of a
solution to issue 2630.  Fastrand1 still needs to be updated to provide
us with actually random bits.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5599046
2012-01-31 00:37:03 -05:00
Russ Cox
2050a9e478 build: remove Make.pkg, Make.tool
Consequently, remove many package Makefiles,
and shorten the few that remain.

gomake becomes 'go tool make'.

Turn off test phases of run.bash that do not work,
flagged with $BROKEN.  Future CLs will restore these,
but this seemed like a big enough CL already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Russ Cox
56e6a02490 runtime: fix mkasmh.sh for arm?
The builder is Debian, so maybe running dash,
the shell that time forgot.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5600053
2012-01-30 23:17:11 -05:00
Anthony Martin
bacb1b70f7 runtime: fix mkasmh.h
We weren't properly deleting the various header
files (that were temporarily renamed) if a $CC
for the current $GOARCH didn't exist.  And since
the compiler checks the current directory for
headers before any -I arguments, this had the
unfortunate side effect of including the last
generated headers instead of the correct ones.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5581055
2012-01-30 19:25:40 -08:00
Nigel Tao
10498f4d33 image: remove image/bmp and image/tiff from std.
They have moved to the code.google.com/p/go.image subrepo.

R=rsc
CC=golang-dev
https://golang.org/cl/5552052
2012-01-31 14:01:53 +11:00
Rob Pike
91cb3489ab go: move compilers into the go-tool directory
Also delete gotest, since it's messy to fix and slated for deletion anyway.
A couple of things outside src can't be tested any more. "go test" will be
fixed and these tests will be re-enabled. They're noisy for now.

Fixes #284.

R=rsc
CC=golang-dev
https://golang.org/cl/5598049
2012-01-30 14:46:31 -08:00
Brad Fitzpatrick
eb53d472ef doc: use consistent receiver names, when it makes sense.
Makes for prettier docs.

R=golang-dev, dsymonds, r, rsc
CC=golang-dev
https://golang.org/cl/5576056
2012-01-30 11:58:49 -08:00
Brad Fitzpatrick
25c96cba2e json: remove old optimization that inlining covers now
Benchmarks look the same.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5572080
2012-01-30 11:42:09 -08:00
Gustavo Niemeyer
9c497443ae encoding/xml: fix decoding of xml.Name with sub-elements
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5569090
2012-01-30 16:32:48 -02:00
Russ Cox
cb34f5c357 compress/flate: undo misuse of skipNever
I assume this was a too aggressive search-and-replace.

R=imkrasin
CC=golang-dev
https://golang.org/cl/5580047
2012-01-30 13:24:20 -05:00
Russ Cox
e451fb8ffb fmt: add test of NaN map keys
R=r
CC=golang-dev
https://golang.org/cl/5564063
2012-01-30 13:20:38 -05:00
Olivier Duperray
74e8a1308a pkg/go/scanner: Fix Typical use output
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5595045
2012-01-30 09:58:25 -08:00
Russ Cox
022aac7883 runtime: fix float64 hash
R=ken2
CC=golang-dev
https://golang.org/cl/5580046
2012-01-30 11:10:59 -05:00
Volker Dobler
ed7a8f7159 net/http: Fix nil pointer dereference in error case.
R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/5598044
2012-01-30 07:57:50 -08:00
Alex Brainman
dcbc77d2cf os/user: windows implementation
pjmlp gets credit for initial version.

Fixes #1789.

R=paulo.jpinto, bradfitz, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/5543069
2012-01-30 22:59:10 +11:00
Gustavo Niemeyer
1e5b7e706e cmd/goinstall: remove now that 'go get' works
The changes to builder were not tested.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5572083
2012-01-29 17:22:20 -02:00
Volker Dobler
d91ade02e7 net/http: set cookies in client jar on POST requests.
Cookies recieved in a response to a POST request are stored
in the client's jar like they are for GET requests.

R=golang-dev, rsc
CC=bradfitz, golang-dev
https://golang.org/cl/5576065
2012-01-29 14:16:11 -05:00
Rob Pike
71d83b72ef cmd/go: add go tools to rearrangement
fix, vet
yacc is also fixed (it was wrong before)
All that's left is the commands used during compilation
This looks like a huge CL, but it's almost all file renames.
The action is in cmd/go/pkg.go, the Makefiles, and .../doc.go.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5595044
2012-01-29 11:07:25 -08:00
Rob Pike
79dc34413e cmd/go: first piece of tool rearrangement
1) create go-tool dir in make.bash
2) clean up stale binaries in make.bash
3) add 'tool' command to go
4) convert goyacc->yacc as a first test tool
Since goyacc stands alone, it's a safe trial.

R=rsc
CC=golang-dev
https://golang.org/cl/5576061
2012-01-29 09:19:05 -08:00
Mikio Hara
3d400db5de net: update comments to remove redundant "net" prefix
R=rsc, r
CC=golang-dev
https://golang.org/cl/5569087
2012-01-29 19:11:05 +09:00
Brad Fitzpatrick
a3fdd6e649 os: remove SIGXXX signals variables.
They're not portable, and pkg os is supposed to be portable.

Fixes #2562

R=golang-dev, mikioh.mikioh, r, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5574078
2012-01-27 14:47:02 -08:00
Robert Griesemer
b3a5f9e51b go/doc: don't show methods of exported anonymous fields
Added flag AllMethods: if not set (future default), embedded
methods of exported (and thus visible) embedded fields are not
shown in the final package documentation

The actual change for AllMethods is just in sortedFuncs. All
other changes are simplifications of the existing logic (mostly
deletion of code): Because method conflicts due to embedding
must always be detected, remove any premature elimination of
types and methods. Instead collect all named types and all
methods and do the filtering at the end.

Miscellaneous:
- renamed baseType -> namedType
- streamline logic for recording embedded types
- record embedded types via a map (simpler data structures)

AllMethods is set by default; so the output is unchanged and
the tests pass. The next CL will enable the AllMethods flag
and have adjusted tests (and fix issue 2791).

R=rsc
CC=golang-dev
https://golang.org/cl/5572076
2012-01-27 14:45:47 -08:00
Robert Griesemer
a0d0ed2002 go/doc: added test case
Don't show conflicting method embedded via
a visible and invisible anonymous field.

R=rsc
CC=golang-dev
https://golang.org/cl/5564064
2012-01-27 14:45:31 -08:00
Russ Cox
c4303aa59f reflect: add comment about Type.Field allocation
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5586044
2012-01-27 16:11:17 -05:00
Ivan Krasin
903752f484 compress/flate: remove unused huffmanEncoder.generateChains.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/5577061
2012-01-27 09:52:58 -08:00
Brad Fitzpatrick
b79ba6a609 flag: allow a FlagSet to not write to os.Stderr
Fixes #2747

R=golang-dev, gri, r, rogpeppe, r
CC=golang-dev
https://golang.org/cl/5564065
2012-01-27 09:23:06 -08:00
Dmitriy Vyukov
75397e65ee net/rpc: fix data race on Call.Error
+eliminates a possibility of sending a call to Done several times.
+fixes memory leak in case of temporal Write errors.
+fixes data race on Client.shutdown.
+fixes data race on Client.closing.
+fixes comments.
Fixes #2780.

R=r, rsc
CC=golang-dev, mpimenov
https://golang.org/cl/5571063
2012-01-27 11:27:05 +04:00
Brad Fitzpatrick
b62a5099e4 archive/zip: add functions to convert between os.FileInfo & FileHeader
Fixes #2186

R=golang-dev, gri, adg
CC=golang-dev
https://golang.org/cl/5579044
2012-01-26 15:31:09 -08:00
James P. Cooper
2a22f35598 database/sql: convert SQL null values to []byte as nil.
Also allow string values to scan into []byte.
Fixes #2788.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5577054
2012-01-26 15:12:48 -08:00
Brad Fitzpatrick
899cd04e21 net/http: add Request.RequestURI field
The new url.URL's parsing can be too canonicalizing for
certain applications. By keeping the original request URI
around, we give applications a gross escape hatch while
keeping the URL package clean and simple for normal uses.

(From a discussion with Gary Burd, Gustavo Niemeyer,
and Russ Cox.)

Fixes #2782

R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5580044
2012-01-26 14:37:14 -08:00
Russ Cox
408f0b1f74 gc, runtime: handle floating point map keys
Fixes #2609.

R=ken2
CC=golang-dev
https://golang.org/cl/5572069
2012-01-26 16:25:07 -05:00
Robert Griesemer
8a90a8861f math/big: test both bitLen and bitLen_g
Also: simpler, more direct test.

R=golang-dev, dave.andersen
CC=golang-dev
https://golang.org/cl/5573070
2012-01-26 10:08:21 -08:00
Roger Peppe
32d7a7364f net/http: make ParseForm ignore unknown content types.
Also fix a shadowed error variable bug.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5573072
2012-01-26 16:50:56 +00:00
Mikio Hara
974fa75557 net: make WriteTo fail when UDPConn is already connected
Fixes #2773.

R=rsc
CC=golang-dev
https://golang.org/cl/5571056
2012-01-27 01:31:42 +09:00
Dmitriy Vyukov
eaa8b30d5a net/rpc: log Call reply discard
It means serious user error that can lead to
hard to debug issues under load, log entry
will not harm.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5574075
2012-01-26 20:09:09 +04:00
Dmitriy Vyukov
290921bbb5 net/rpc: fix data race in benchmark
Fixes #2781.

R=golang-dev, rsc
CC=golang-dev, mpimenov
https://golang.org/cl/5577053
2012-01-26 20:06:27 +04:00
Dmitriy Vyukov
fa32b16413 net/rpc: fix race in TestClientWriteError test
Fixes #2752.

R=golang-dev, mpimenov, r
CC=golang-dev
https://golang.org/cl/5571062
2012-01-26 11:37:07 +04:00
Rob Pike
f8a28ecc9f path/filepath: fix test
If there's an error, sometimes you need to stop.
Part of issue 2787.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5570068
2012-01-25 20:19:55 -08:00
Blake Mizerany
bcb976c5b2 database/sql: fix Tx.Query
Fixes #2784

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5574073
2012-01-25 17:49:30 -08:00
James P. Cooper
c21b343438 database/sql: add NullInt64, NullFloat64, NullBool
Fixes #2699

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5557063
2012-01-25 17:47:32 -08:00
Robert Griesemer
ea347c0142 go/doc: fix typo
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5574071
2012-01-25 17:09:50 -08:00
Robert Griesemer
d571c5ca78 go/doc: revert API change (per former discussion) and cleanup
Separating Method from Func made the code only more complicated
without adding much to the useability/readability of the API.
Reverted to where it was, but leaving the new method-specific
fields Orig and Level.

Former clients (godoc) of doc.Method only used the Func fields;
and because Func was embedded, no changes are needed with respect
to the removal of Method.

Changed type of Func.Recv from ast.Expr to string. This was a
long-standing TODO. Also implemented Func.Orig field (another TODO).

No further go/doc API changes are expected for Go 1.

R=rsc, r, r
CC=golang-dev
https://golang.org/cl/5577043
2012-01-25 16:48:06 -08:00
David G. Andersen
1e09031f7f math/big: return type of bitLen is an int; use MOVL on amd64.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5577050
2012-01-25 16:09:12 -08:00
David G. Andersen
316f81bb1d math/big: assembly versions of bitLen for x86-64, 386, and ARM.
Roughly 2x speedup for the internal bitLen function in arith.go.  Added TestWordBitLen test.

Performance differences against the new version of
bitLen generic:

x86-64 Macbook pro (current tip):

benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0             6            4  -37.40%
big.BenchmarkBitLen1             6            2  -51.79%
big.BenchmarkBitLen2             6            2  -65.04%
big.BenchmarkBitLen3             6            2  -66.10%
big.BenchmarkBitLen4             6            2  -60.96%
big.BenchmarkBitLen5             6            2  -55.80%
big.BenchmarkBitLen8             6            2  -56.19%
big.BenchmarkBitLen9             6            2  -64.73%
big.BenchmarkBitLen16            7            2  -68.84%
big.BenchmarkBitLen17            6            2  -67.11%
big.BenchmarkBitLen31            7            2  -61.57%

386 Intel Atom (current tip):
benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0            23           20  -13.04%
big.BenchmarkBitLen1            23           20  -14.77%
big.BenchmarkBitLen2            24           20  -19.28%
big.BenchmarkBitLen3            25           20  -21.57%
big.BenchmarkBitLen4            24           20  -16.94%
big.BenchmarkBitLen5            25           20  -20.78%
big.BenchmarkBitLen8            24           20  -19.28%
big.BenchmarkBitLen9            25           20  -20.47%
big.BenchmarkBitLen16           26           20  -23.37%
big.BenchmarkBitLen17           26           20  -25.09%
big.BenchmarkBitLen31           32           20  -35.51%

ARM v5 SheevaPlug, previous weekly patched with bitLen:
benchmark                old ns/op    new ns/op    delta
big.BenchmarkBitLen0            50           29  -41.73%
big.BenchmarkBitLen1            51           29  -42.75%
big.BenchmarkBitLen2            59           29  -50.08%
big.BenchmarkBitLen3            60           29  -50.75%
big.BenchmarkBitLen4            59           29  -50.08%
big.BenchmarkBitLen5            60           29  -50.75%
big.BenchmarkBitLen8            59           29  -50.08%
big.BenchmarkBitLen9            60           29  -50.75%
big.BenchmarkBitLen16           69           29  -57.35%
big.BenchmarkBitLen17           70           29  -57.89%
big.BenchmarkBitLen31           95           29  -69.07%

R=golang-dev, minux.ma, gri
CC=golang-dev
https://golang.org/cl/5574054
2012-01-25 15:04:16 -08:00
Yoshiyuki Kanno
d645adc3d0 net/http: fix Transport deadlock
This patch intend to fix following issues.
http://code.google.com/p/go/issues/detail?id=2616

Fixes #2616.

R=golang-dev, bradfitz, nekotaroh
CC=golang-dev
https://golang.org/cl/5532057
2012-01-25 15:00:39 -08:00
Brad Fitzpatrick
73ce14d0aa regexp: remove vestigial Error type
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5573069
2012-01-25 14:50:37 -08:00
Mikio Hara
9acea02de2 net: fix dialing google test
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5573060
2012-01-26 07:38:49 +09:00
Robert Griesemer
dbce368ef9 go/doc: test cases for sort order
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5569059
2012-01-25 13:56:12 -08:00
Robert Figueiredo
82d06e8f3c syscall: add NOTE_* constants on OS X
R=rsc
CC=golang-dev
https://golang.org/cl/5570043
2012-01-25 15:50:23 -05:00
Russ Cox
bf67a7b9b1 build: fix build
I said rm, but not hg rm.
I never was good at Simon says.

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5574066
2012-01-25 15:41:49 -05:00
Brad Fitzpatrick
cf09a9d3bf net/http: disabled test for Transport race / deadlock bug
The real fix for Issue 2616 is in
https://golang.org/cl/5532057, to be submitted
following this CL, without the test there which doesn't work
reliably. This one seems to.

R=rsc
CC=golang-dev
https://golang.org/cl/5569063
2012-01-25 12:31:06 -08:00
Russ Cox
0368ca138b build: remove code now in subrepositories
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5569064
2012-01-25 15:30:42 -05:00
Robert Griesemer
8efc020d7c go/printer: factor some frequently used code
Added a cache to compensate for extra call overhead.
go test -bench=Print marginally faster (in the noise).

R=r
CC=golang-dev
https://golang.org/cl/5574061
2012-01-25 10:45:16 -08:00
Robert Griesemer
d665ea98f3 go/printer, gofmt: respect line breaks in signatures
No changes when applying gofmt to src, misc.

Fixes #2597.

R=r
CC=golang-dev
https://golang.org/cl/5564056
2012-01-25 10:21:13 -08:00