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

2083 Commits

Author SHA1 Message Date
Russ Cox
9a96fb3a29 mkall.sh, mkerrors.sh: work more broadly
work on FreeBSD even without /usr/src/sys.
work on systems where gcc -static is broken.

TBR so I can test my semi-automated z builder.

TBR=adg
CC=golang-dev
https://golang.org/cl/2215046
2010-09-24 13:37:02 -04:00
Russ Cox
fb7e175d1f debug/proc: ... changes (fix build)
TBR=gri
CC=golang-dev
https://golang.org/cl/2229047
2010-09-24 13:12:50 -04:00
Russ Cox
d8fc38c7b8 crypto/ocsp: update for asn1 change (fix build)
TBR=gri
CC=golang-dev
https://golang.org/cl/2221044
2010-09-24 13:08:35 -04:00
Russ Cox
8206bafb22 asn1: make interface consistent with json
Replace Marshal with MarshalToMemory
(no one was using old Marshal anyway).

Swap arguments to Unmarshal.

Fixes #1133.

R=agl1
CC=golang-dev
https://golang.org/cl/2249045
2010-09-24 12:34:18 -04:00
Dan Sinclair
8d87ccad0b xml: Allow entities inside CDATA tags
Fixes #1112.

R=rsc
CC=golang-dev
https://golang.org/cl/2255042
2010-09-24 12:23:01 -04:00
Russ Cox
2ee420fa5e ... changes
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/2273042
2010-09-24 11:55:48 -04:00
Russ Cox
34d413f562 runtime: fix unwindstack crash
Bug and fix identified by Alexey Gokhberg.
Fixes #1135.

R=r, brainman
CC=golang-dev
https://golang.org/cl/2198046
2010-09-23 23:04:32 -04:00
Rob Pike
e439345dfd bufio.UnreadRune: fix bug at EOF
Fixes #1132.

R=rsc
CC=golang-dev
https://golang.org/cl/2215045
2010-09-24 12:28:14 +10:00
Nigel Tao
099d7b4d1d exp/draw: remove "this isn't ready yet" comments.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2248046
2010-09-24 12:15:49 +10:00
Peter Mundy
bfb127612a os: check for valid arguments in windows Readdir
Fixes #1129.

R=rsc, brainman
CC=Joe Poirier, golang-dev
https://golang.org/cl/2211045
2010-09-23 22:06:59 -04:00
Russ Cox
7c9f0f0109 html: disable print
Everything is incomplete.
Let's not make noise like this a habit.

R=nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2272041
2010-09-23 22:05:42 -04:00
Russ Cox
052cd29dd6 nacl: update instructions for new SDK
R=nigeltao_gnome, nigeltao
CC=golang-dev
https://golang.org/cl/2253042
2010-09-23 22:05:20 -04:00
Rob Pike
344600f689 fmt/Printf: document and tweak error messages produced for bad formats
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2198044
2010-09-24 11:53:26 +10:00
Nigel Tao
d181625b9c exp/spacewar: fix build.
R=rsc
CC=golang-dev
https://golang.org/cl/2265042
2010-09-24 11:07:52 +10:00
Robert Griesemer
44b3b20524 gofmt: preserve syntactically relevant blanks between ints and tokens that start with a '.' (2nd attempt)
R=rsc
CC=golang-dev
https://golang.org/cl/2270042
2010-09-23 14:56:44 -07:00
Robert Griesemer
0716d95092 gofmt: don't remove syntactically relevant blank in f(42 ...)
R=rsc
CC=golang-dev
https://golang.org/cl/2246046
2010-09-23 14:20:13 -07:00
Russ Cox
f3549d8323 io/ioutil: use _test not _obj in test
Fixes: make clean; make test

R=gri
CC=golang-dev
https://golang.org/cl/2234044
2010-09-23 14:31:44 -04:00
Roger Peppe
81ba399a6a bytes, strings: change lastIndexFunc to use DecodeLastRune
R=r
CC=golang-dev, rsc
https://golang.org/cl/2271041
2010-09-23 20:40:11 +10:00
Roger Peppe
f11271b82e utf8: add DecodeLastRune and DecodeLastRuneInString to
enable traversing rune-by-rune backwards in strings

R=r, rsc
CC=golang-dev
https://golang.org/cl/2192050
2010-09-23 20:33:52 +10:00
Rob Pike
1959c3ac5b tests: fix prints
- delete unnecessary newlines
- make sure formatted prints call the formatting routines

R=adg
CC=golang-dev
https://golang.org/cl/2225046
2010-09-23 13:48:56 +10:00
Alex Brainman
c10865ce53 syscall: implement windows version of Utimes()
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/2215044
2010-09-23 12:36:52 +10:00
Nigel Tao
43527e9dbb netchan: fix comment typo.
R=adg
CC=golang-dev
https://golang.org/cl/2204047
2010-09-23 11:32:11 +10:00
Roger Peppe
0f17173f79 exp/draw: add Point.Eq, Point.Mul, Point.Div, Rectangle.Size methods
R=nigeltao, nigeltao_golang, rsc
CC=golang-dev, r
https://golang.org/cl/2192048
2010-09-23 10:58:59 +10:00
Andrew Gerrand
1a8bd6715d http: fix redirect test for international users
R=r
CC=golang-dev
https://golang.org/cl/2197047
2010-09-23 10:40:07 +10:00
Ian Lance Taylor
7b175236cb http: Change redirect test URL, as the old one now fails.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2267042
2010-09-22 14:20:15 -07:00
Robert Griesemer
a6b6142f30 gofmt: support for ... after actual arguments
Pending acceptance of the proposed language change.

R=rsc
CC=golang-dev
https://golang.org/cl/2193048
2010-09-22 14:05:14 -07:00
Robert Griesemer
3487495eb0 suffixarray: cleanup per suggestion from Roger Peppe
R=rsc
CC=golang-dev
https://golang.org/cl/2213045
2010-09-22 11:03:57 -07:00
Andrew Gerrand
ad9042bdfa http: don't always escape all reserved chars (fix build)
R=nigeltao, nigeltao_golang
CC=golang-dev
https://golang.org/cl/2206044
2010-09-22 16:59:35 +10:00
Andrew Gerrand
d093bdbe7e http: escape _all_ reserved characters as per the RFC
R=r
CC=golang-dev
https://golang.org/cl/2199043
2010-09-22 16:25:26 +10:00
Robert Griesemer
22974fbe8e suffixarray: a package for creating suffixarray-based indexes
This is a replacement for pending CL 2219042. It only contains
the raw suffixarray functionality with two methods:

- New       create a new index from some data
- Lookup    lookup occurences of a bytes slice in the data

Any other functionality (dealing with multiple data sets and
the corresponding position lists) is generic and doesn't have
to be part of this package.

Known performance bug: This implementation works fine for data sets
up to several megabytes as long as it doesn't contain very long
contiguous sequences of equal bytes. For instance, index creation for
all .go files under GOROOT (250KLOCs, approx. 9MB) takes ~50s on
2.66 GHz Intel Xeon as long as test/fixedbugs/257.go is excluded.
With that file, index creation times takes several days. 257.go contains
a string of 1M smiley faces.

There are more sophisticated suffixarray creation algorithms which
can handle very long common prefixes. The implementation can be
updated w/o the need to change the interface.

R=rsc, r, PeterGo
CC=golang-dev
https://golang.org/cl/2265041
2010-09-21 23:12:57 -07:00
Anthony Martin
176364900e fmt: support '*' for width or precision
R=r
CC=golang-dev
https://golang.org/cl/2237044
2010-09-22 16:10:38 +10:00
Russ Cox
b7cb844ac8 build: make all.bash run on Ubuntu ARM
Sent from my phone.

R=adg
CC=golang-dev
https://golang.org/cl/2192049
2010-09-22 15:30:42 +10:00
Alex Brainman
a071853015 os: make Open() O_APPEND flag work on windows
Fixes #1124.
Implementation is suggested by Skip.
Test is suggested by PeterGo.

R=r, PeterGo, rsc
CC=golang-dev, skip.tavakkolian
https://golang.org/cl/2256041
2010-09-22 13:12:25 +10:00
Roger Peppe
8ee986570a strings: fix minor bug in LastIndexFunc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2250042
2010-09-21 22:58:09 -04:00
Russ Cox
a2450c1456 cgo: bug fixes
* Add documentation about array arguments.  Fixes issue 1125.
* Do not interpret x, y := z, w as special errno form.  Fixes issue 952.
* Fix nested Go calls (brainman).  Fixes issue 907.

R=r
CC=golang-dev
https://golang.org/cl/2214044
2010-09-21 22:41:19 -04:00
Nigel Tao
58795ea31a exp/4s, exp/nacl/av: sync to recent exp/draw changes.
R=rsc
CC=golang-dev
https://golang.org/cl/2257042
2010-09-22 12:20:56 +10:00
Ian Lance Taylor
7d03d0ec6b syscall: Use vsyscall for syscall.Gettimeofday and .Time on linux amd64.
Regenerate zsyscall_linux_*.go files with recent changes to
mksyscall.sh.

Add socketpair to syscall_linux_amd64.go; for some reason it
was in the generated file but not in the source file.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2190044
2010-09-21 06:49:56 -07:00
Rob Pike
4659f6de38 regexp: delete Iter methods
They are unused and not that useful anyway.

R=rsc
CC=golang-dev
https://golang.org/cl/2225045
2010-09-21 21:21:44 +10:00
Nigel Tao
bd77a889e6 exp/nacl/av: update color to max out at 1<<16-1 instead of 1<<32-1.
Fix missing return in Set(x, y, color).

R=r
CC=golang-dev
https://golang.org/cl/2256042
2010-09-21 16:13:19 +10:00
Adam Langley
8e5f673dac crypto/x509, crypto/tls: improve root matching and observe CA flag.
The key/value format of X.500 names means that it's possible to encode
a name with multiple values for, say, organisation. RFC5280
doesn't seem to consider this, but there are Verisign root
certificates which do this and, in order to find the correct
root certificate in some cases, we need to handle it.

Also, CA certificates should set the CA flag and we now check
this. After looking at the other X.509 extensions it appears
that they are universally ignored/bit rotted away so we ignore
them.

R=rsc
CC=golang-dev
https://golang.org/cl/2249042
2010-09-20 12:17:31 -04:00
Adam Langley
6989f6e312 Fix certificate validation.
asn1: add support for T61String because this is the string type which
    several www.google.com certificates are now using for fields like
    CommonName
tls: force a handshake in Dial so that certificates are ready
    afterwards.

Fixes #1114.

R=rsc
CC=golang-dev
https://golang.org/cl/2216043
2010-09-20 10:32:08 -04:00
Rob Pike
724886b0c0 netchan: fix unimportant typo in test error call.
R=adg
CC=golang-dev
https://golang.org/cl/2211044
2010-09-20 17:24:40 +10:00
Rob Pike
da705c6212 netchan: provide a method (Importer.Errors()) to recover protocol errors.
R=rsc
CC=golang-dev
https://golang.org/cl/2229044
2010-09-20 15:28:38 +10:00
Russ Cox
950ee18366 syscall: fix NaCl
missing from last CL, sorry

R=r
CC=golang-dev
https://golang.org/cl/2214043
2010-09-19 23:28:45 -04:00
Russ Cox
d4baf3ccb7 runtime: better panic for send to nil channel
*Much* better on NaCl, where memory faults are deadly.

R=r
CC=golang-dev
https://golang.org/cl/2249041
2010-09-19 23:28:12 -04:00
Russ Cox
e769342614 nacl: fix zero-length writes
NaCl rejects zero-length write using nil pointer.

R=r
CC=golang-dev
https://golang.org/cl/2237042
2010-09-19 22:52:30 -04:00
Russ Cox
af12feb8d5 6l, 8l: clean up ELF code, fix NaCl
R=r
CC=golang-dev
https://golang.org/cl/2221042
2010-09-19 22:10:34 -04:00
Nigel Tao
afbee9d87d exp/draw/x11: mouse location is a signed integer.
R=r
CC=golang-dev
https://golang.org/cl/2192043
2010-09-20 10:18:09 +10:00
Rob Pike
1e4b1f9337 netchan: handle closing of channels.
This also silences some misleading logging.
Also improve logging.

R=rsc
CC=golang-dev
https://golang.org/cl/2245041
2010-09-20 10:14:39 +10:00
Rob Pike
c8b3d02939 gob: make robust when decoding a struct with non-struct data.
The decoder was crashing when handling an rpc that expected
a struct but was delivered something else.  This diagnoses the
problem.  The other direction (expecting non-struct but getting
one) was already handled.

R=rsc
CC=golang-dev
https://golang.org/cl/2246041
2010-09-20 07:37:06 +10:00
Rob Pike
42a61b920e windows: fix netchan test by using 127.0.0.1.
Re-enable the test on Windows.

R=brainman, alex.brainman
CC=golang-dev
https://golang.org/cl/2244041
2010-09-18 11:43:10 +10:00
Alex Brainman
289432daff pkg/Makefile: disable netchan test to fix windows build
R=r
CC=golang-dev
https://golang.org/cl/2225042
2010-09-18 11:09:08 +10:00
Alex Brainman
9997dae7a3 os: make RemoveAll() work on windows
R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/2212041
2010-09-17 12:35:34 +10:00
Robert Griesemer
7534d40f64 fix various comments
(os package comments were duplicates)

R=rsc
CC=golang-dev
https://golang.org/cl/2205042
2010-09-16 18:21:01 -07:00
Rob Pike
19075ea609 netchan: add a cross-connect test.
Suggested in a bug report (since addressed) by Axel Schreiner.

R=rsc
CC=golang-dev
https://golang.org/cl/2228041
2010-09-17 07:12:54 +10:00
Fazlul Shahriar
dd0dec6290 net/dict: parse response correctly + typo
* SHOW DB responds with a
  "110 n databases present - text follows" -- parse it.
* Doing a Define() on a non-existing word gives error
  "invalid definition count: no", when we really
  want "552 no match".

R=rsc
CC=golang-dev
https://golang.org/cl/2211041
2010-09-16 13:37:35 -04:00
Rob Pike
381ab58e2c netchan: fix bug for imported send.
Also add a bit of debugging and sanitation code.
Fixes #769.

R=adg
CC=golang-dev
https://golang.org/cl/2206042
2010-09-16 13:59:31 +10:00
Robert Griesemer
304d72be8c os: error in documentation
R=r
CC=golang-dev
https://golang.org/cl/2225041
2010-09-15 15:38:16 -07:00
Rob Pike
8d831de685 netchan: make -1 unlimited, as advertised.
R=adg
CC=golang-dev
https://golang.org/cl/2198042
2010-09-14 23:41:37 -07:00
Sebastien Binet
caf3b4a749 Preliminary support for 'copy' builtin function in exp/eval
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/2157042
2010-09-14 17:25:34 +10:00
Rob Pike
6ee7997366 fmt.Fscan: use UnreadRune to preserve data across calls.
Fixes #1055.
(About as well as it can be fixed without changing the API.)

R=rsc
CC=golang-dev
https://golang.org/cl/2156047
2010-09-14 11:06:17 +10:00
Scott Lawrence
c5a51cc90f json: Add package comment
R=golang-dev, r2, r
CC=golang-dev
https://golang.org/cl/2149047
2010-09-13 16:03:27 +10:00
Nigel Tao
86b821f92b libcgo: fix NaCl build.
R=r, rsc, nigeltao
CC=golang-dev
https://golang.org/cl/2110046
2010-09-13 13:12:46 +10:00
Alex Brainman
77a70ddb7b gc: fix symbol table generation on windows
gc records full, '/' delimited, filenames now.

R=rsc
CC=golang-dev
https://golang.org/cl/1962042
2010-09-12 18:07:13 +10:00
Rob Pike
acb695f421 bufio: add UnreadRune.
R=rsc
CC=golang-dev
https://golang.org/cl/2103046
2010-09-12 17:40:27 +10:00
Joe Poirier
b155a76a40 exec.LookPath() unix/windows separation
R=brainman, rsc, vcc, rsc1
CC=golang-dev
https://golang.org/cl/2068041
2010-09-12 17:38:36 +10:00
Russ Cox
f47d403cb4 gc: make string x + y + z + ... + w efficient
1 malloc per concatenation.

R=ken2
CC=golang-dev
https://golang.org/cl/2124045
2010-09-12 00:53:04 -04:00
Russ Cox
be443ee8bc 5g: register allocation bugs
Fixes #1099.

R=ken2, r
CC=golang-dev
https://golang.org/cl/2147047
2010-09-12 00:06:45 -04:00
Russ Cox
6e6fc67425 math: make portable Tan(Pi/2) return NaN
The panic NaN was a translation error.
The earliest version said panic "return sys.NaN()",
and when sys.NaN came along, it changed
to "panic sys.NaN()" instead of "return sys.NaN()".

R=r
CC=golang-dev
https://golang.org/cl/2106049
2010-09-11 23:41:25 -04:00
Russ Cox
a4514c42dd http: check https certificate against host name
Fixes #1093.

R=agl, agl1
CC=golang-dev
https://golang.org/cl/2115045
2010-09-11 23:41:12 -04:00
Alex Brainman
e3a0c2f6cf net: disable tests for functions not available on windows
R=r, Joe Poirier, rsc
CC=golang-dev
https://golang.org/cl/2123044
2010-09-12 12:02:29 +10:00
Alex Brainman
f95a2f2b97 runtime(windows): make sure scheduler runs on os stack and new stdcall implementation
R=rsc
CC=golang-dev
https://golang.org/cl/2009045
2010-09-12 11:45:16 +10:00
Jukka-Pekka Kekkonen
50e0fb4c79 websocket: Add support for secure WebSockets
Fixes #842.
Fixes #1061.

R=rsc
CC=golang-dev
https://golang.org/cl/2119042
2010-09-11 00:27:16 -04:00
Russ Cox
befecf6b59 runtime: fix crash trace on amd64
g is not in r15 anymore.
now it's in a per-thread memory segment,
which is valid even inside a signal handler,
so we can just refer to g directly.

Fixes #1082.

R=r
CC=golang-dev
https://golang.org/cl/2149045
2010-09-11 00:26:56 -04:00
Rob Pike
0aa2317096 arm: work around reg allocator bug in 5g, in two parts.
1) hack regalloc to leave R9 (m) and R10 (g) alone.
the real fix is tricker, but this gets us running
2) fix up the few places in the package sources that
the shortage of registers affects, by simplifying
some expressions.

all of this should be reverted when the right fix is in.

Fixes #1084.

R=rsc
CC=golang-dev
https://golang.org/cl/2132046
2010-09-10 20:55:29 -07:00
Adam Langley
5011c27018 crypto/tls: don't return an error from Close()
Fixes #1037.

R=adg, rsc1
CC=golang-dev
https://golang.org/cl/2107048
2010-09-10 15:55:35 -04:00
Russ Cox
0f5830b9c3 net: fix windows build
R=adg
CC=golang-dev
https://golang.org/cl/2111045
2010-09-10 15:50:29 -04:00
Russ Cox
9c1b6dffd6 net: fix freebsd build
R=adg
CC=golang-dev
https://golang.org/cl/2174043
2010-09-10 14:40:56 -04:00
Joe Poirier
41e5a78441 windows: disable unimplemented tests
Add windows NOTEST list to pkg make file.
5a make file. the change removes a space
character that was included when appending
an extension to TARG.

R=brainman, rsc
CC=golang-dev
https://golang.org/cl/2140046
2010-09-10 14:05:57 -04:00
Nigel Tao
5801928817 exp/draw: fast path for drawing overlapping image.RGBAs.
R=r, nigeltao
CC=golang-dev
https://golang.org/cl/2145045
2010-09-10 20:09:56 +10:00
Nigel Tao
d660d4a6d0 exp/draw: fix double-counting of pt.Min for the src and mask points.
The min is typically zero, which is why this hasn't bitten us yet.

R=r
CC=golang-dev
https://golang.org/cl/2119048
2010-09-10 19:48:27 +10:00
Rob Pike
66f676b8ef arm: fix a couple of build bugs.
tests have not been run yet

R=stephenm
CC=golang-dev
https://golang.org/cl/2165046
2010-09-09 23:31:33 -07:00
Alex Brainman
f5089ffff4 syscall: fix windows Gettimeofday
Fixes #1092.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/2121048
2010-09-10 15:39:45 +10:00
Nigel Tao
2deee2936c exp/draw: clip destination rectangle to the image bounds.
image: introduce Intersect and Union rectangle methods.

R=r, rog, nigeltao
CC=golang-dev
https://golang.org/cl/2115043
2010-09-09 19:12:54 +10:00
Nigel Tao
6c8b85273c exp/draw: rename Context to Window, and add a Close method.
exp/draw/x11: allow clean shutdown when the user closes the window.

R=r
CC=golang-dev
https://golang.org/cl/2134045
2010-09-09 18:06:59 +10:00
Ivan Krasin
dfb2af6099 path: add IsAbs
R=rsc, imkrasin, r
CC=golang-dev
https://golang.org/cl/1969042
2010-09-09 01:42:43 -04:00
Robert Griesemer
c4e27b7cfb gofmt, go/printer: update internal estimated position correctly
Fixes #1089.

R=rsc
CC=golang-dev
https://golang.org/cl/2172043
2010-09-08 22:01:48 -07:00
Rob Pike
ba5175401e runtime: fix bug in tracebacks
Need to correct for deferproc's extra 2 words of stack or in some
cases (such as memory profiling) traceback can cause a crash.
Also bulletproof the closure test.

R=rsc
CC=golang-dev
https://golang.org/cl/2138047
2010-09-09 14:28:56 +10:00
Alex Brainman
89e9231865 runtime: fix windows build
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2135045
2010-09-09 12:09:10 +10:00
Andrew Gerrand
55986c1329 path: fix typo in path.Visitor
Fixes #1088.

R=gri, iant
CC=golang-dev
https://golang.org/cl/2157043
2010-09-09 09:24:27 +10:00
Jukka-Pekka Kekkonen
f7a71c6505 http: do not cache CanonicalHeaderKey
Fixes #1080.

R=rsc
CC=golang-dev
https://golang.org/cl/2158043
2010-09-08 10:20:21 -04:00
Russ Cox
e50611d235 os, exec: rename argv0 to name
R=r, gri1
CC=golang-dev
https://golang.org/cl/2119044
2010-09-07 16:29:07 -04:00
Russ Cox
636342292c runtime: fix linux/amd64 build: wrong name for munmap
TBR=r
CC=golang-dev
https://golang.org/cl/2140043
2010-09-07 13:17:10 -04:00
Russ Cox
d4cc557b0d runtime: use manual stack for garbage collection
Old code was using recursion to traverse object graph.
New code uses an explicit stack, cutting the per-pointer
footprint to two words during the recursion and avoiding
the standard allocator and stack splitting code.

in test/garbage:

Reduces parser runtime by 2-3%
Reduces Peano runtime by 40%
Increases tree runtime by 4-5%

R=r
CC=golang-dev
https://golang.org/cl/2150042
2010-09-07 09:57:22 -04:00
Nigel Tao
fa92b113b1 exp/draw: reintroduce the MouseEvent.Nsec timestamp.
R=rsc
CC=golang-dev
https://golang.org/cl/2166042
2010-09-07 23:42:01 +10:00
Brad Fitzpatrick
34c312e11e arm: use the correct stat syscalls
We were using the 64-bit struct with the old 32-bit
system calls.

http://code.google.com/p/go/issues/detail?id=1083

This also fixes up mksyscall.sh to generate
gofmt-compliant code.

R=rsc
CC=golang-dev, kaib
https://golang.org/cl/2148042
2010-09-07 09:23:49 -04:00
Nigel Tao
832ed355fe image: change a ColorImage's minimum point from (0, 0) to (-1e9, -1e9).
R=r
CC=golang-dev
https://golang.org/cl/2138045
2010-09-07 19:16:59 +10:00
Nigel Tao
c849b23ce9 exp/draw: unify a draw.Context's keyboard, mouse, etc. channels into a
single event channel.

A quit event is now represented by closing that channel.

R=r, rsc, nigeltao
CC=golang-dev
https://golang.org/cl/2114042
2010-09-06 19:22:49 +10:00
Anthony Martin
68cce4ab20 fmt.Scan: fix integer overflow on 32-bit machines
R=r, rsc
CC=golang-dev
https://golang.org/cl/2144043
2010-09-06 08:04:53 +10:00
Rob Pike
d54b921c9b netchan: use acknowledgements on export send.
Also add exporter.Drain() to wait for completion.
This makes it possible for an Exporter to fire off a message
and wait (by calling Drain) for the message to be received,
even if a client has yet to call to retrieve it.

Once this design is settled, I'll do the same for import send.

Testing strategies welcome.  I have some working stand-alone
tests.

R=rsc
CC=golang-dev
https://golang.org/cl/2137041
2010-09-04 23:41:54 +10:00
Rob Pike
6405ab0fae fmt: delete erroneous sentence about return value for Sprint*.
R=rsc
CC=golang-dev
https://golang.org/cl/2160041
2010-09-04 22:29:10 +10:00
Nigel Tao
2b4218f321 image: introduce Config type and DecodeConfig function, to decode an
image's color model and dimensions without allocating and decoding its
actual pixels.

Fixes #695.

R=r
CC=golang-dev
https://golang.org/cl/2151042
2010-09-03 18:03:08 +10:00
Rob Pike
d94fedabb4 list: update comment to state that the zero value is ready to use.
R=gri
CC=golang-dev
https://golang.org/cl/2147042
2010-09-03 17:11:56 +10:00
Robert Griesemer
a37e3697da exp/iterables: fix typo
Fixes #1069.

R=rsc
CC=golang-dev
https://golang.org/cl/2143041
2010-09-02 11:31:00 -07:00
Russ Cox
f699811c14 time: do not crash in String on nil Time
R=r
CC=golang-dev
https://golang.org/cl/2052041
2010-09-02 14:21:40 -04:00
Russ Cox
8d7ae528bf http: add Date to server, Last-Modified and If-Modified-Since to file server
R=r
CC=golang-dev
https://golang.org/cl/2051041
2010-09-02 14:21:11 -04:00
Russ Cox
4e64555894 runtime: add GOOS, GOARCH; fix FuncLine
Changes to FuncLine sync it with symtab.c's funcline.

R=r
CC=girard.m1, golang-dev
https://golang.org/cl/2083041
2010-09-02 14:19:12 -04:00
Andrew Gerrand
2fe0f8da52 http: add PostForm function to post url-encoded key/value data.
This is a common task, so it makes sense to have a helper to do it.

(App Engine doesn't like "Transfer-Encoding: chunked" for POST
bodies, which is the default for regular Post.)

R=rsc
CC=golang-dev
https://golang.org/cl/2113041
2010-09-02 10:01:34 +10:00
Kyle Consalus
f8a67d79d1 Fix incorrect reporting of error in Scanner.next() when Read reads > 0 bytes but returns os.EOF.
R=golang-dev, gri1, gri
CC=golang-dev
https://golang.org/cl/2083042
2010-09-01 15:15:37 -07:00
Rob Pike
3d76135ee5 netchan: rather than 0, make -1 mean infinite, by analogy with strings.Split etc.
It's unlikely to affect any extant code, but I wanted to make this API change
before digging in for a rewrite.

R=rsc
CC=golang-dev
https://golang.org/cl/2112041
2010-09-02 08:10:53 +10:00
Rob Pike
49b19e1b39 fmt: fix typo in package comment.
No semantic change.

R=rsc
CC=golang-dev
https://golang.org/cl/2121041
2010-09-01 22:59:20 +10:00
Scott Lawrence
825e0deece template: fixed documentation formatting
What was meant to be a list appeared as a paragraph with dashes.

R=golang-dev, gri1, gri
CC=golang-dev
https://golang.org/cl/2100041
2010-08-31 19:07:40 -07:00
Robert Griesemer
9f46962c3b big: added RatString, some simplifications
R=rsc
CC=golang-dev
https://golang.org/cl/2095041
2010-08-31 15:18:46 -07:00
Robert Griesemer
3ad995ea88 strconv: fix comment for godoc
R=rsc
CC=golang-dev
https://golang.org/cl/2029042
2010-08-31 14:18:20 -07:00
Ian Lance Taylor
7a2daa7d3a proc, eval: Don't assign address of an array to a slice.
R=rsc
CC=golang-dev
https://golang.org/cl/2084041
2010-08-30 13:47:40 -07:00
Christian Himpel
5c603dbb75 build: remove unnecessary references to GOBIN and GOROOT
All scripts and makefiles assume that GOBIN is correctly set
in PATH.

R=rsc
CC=golang-dev
https://golang.org/cl/2043041
2010-08-30 15:40:56 -04:00
Rob Pike
ca3b5222eb regexp: interpret all Go characer escapes \a \b \f \n \r \t \v
R=rsc
CC=golang-dev
https://golang.org/cl/2042044
2010-08-30 14:06:59 +10:00
Evan Shaw
3972908ead crypto/tls: Fix doc typo
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2073041
2010-08-30 09:59:59 +10:00
Rob Pike
64cb9b6f45 rpc: fix bug that caused private methods to attempt to be registered.
Fixes #1056.

R=golang-dev, adg1
CC=golang-dev
https://golang.org/cl/2033043
2010-08-30 08:03:06 +10:00
Rob Pike
b5664ee320 template: finally fix space handling around actions.
Rewrite the code to express the intention more clearly.

Fixes #1042.

R=rsc
CC=golang-dev
https://golang.org/cl/2011046
2010-08-28 07:52:55 +10:00
Robert Griesemer
8935c8489a gofmt: permit omission of first index in slice expression
R=rsc
CC=golang-dev, r
https://golang.org/cl/2053041
2010-08-27 14:49:49 -07:00
Scott Lawrence
1a0b62a16a go/printer: align ImportPaths in ImportDecls if PackageName is given.
Fixes #1044.

R=gri
CC=golang-dev
https://golang.org/cl/1958047
2010-08-26 22:08:02 -07:00
Charles L. Dorian
bead166a7c math: amd64 version of Sincos
R=rsc
CC=golang-dev
https://golang.org/cl/1939042
2010-08-26 19:03:58 -04:00
Ian Lance Taylor
b279c048e3 netchan: Fix race condition in test.
Two tests start a goroutine which runs exportSend, and then
the tests run importReceive.  exportSend creates an export
channel.  importReceive asks to receive values on that
channel.  Because exportSend runs in a separate goroutine,
it's possible for the export client to receive the request for
values on the channel, from importReceive, before the
goroutine actually creates the export channel.  That causes an
error: "export: no such channel: exportedSend".  This patch
avoids the race by creating the export channel before starting
the goroutine.

There does not seem to be a similar race condition in the
tests which send data in the other direction.

R=r
CC=golang-dev
https://golang.org/cl/2026045
2010-08-26 15:42:18 -07:00
Robert Griesemer
c606b964a0 go/typechecker: 2nd step towards augmenting AST with full type information.
- refine/define Scope, Object, and Type structures
  (note: scope.go has the addition of types, the rest is only re-organized
  for better readability)
- implemented top-level of type checker:
  resolve global type declarations (deal with double decls, cycles, etc.)
- temporary hooks for checking of const/var declarations, function/method bodies
- test harness for fine-grained testing (exact error locations)
  with initial set of tests

This is a subset of the code for easier review.

R=rsc
CC=golang-dev
https://golang.org/cl/1967049
2010-08-26 14:36:13 -07:00
Corey Thomasson
ec72f9bf18 net: add LookupMX
R=rsc
CC=golang-dev
https://golang.org/cl/1976049
2010-08-26 13:32:45 -04:00
Kyle Consalus
4d903504b3 runtime: special case copy, equal for one-word interface values
Based on the observation that a great number of the types that
are copied or compared in interfaces, maps, and channels are
word-sized, this uses specialized copy and equality functions
for them that use a word instead of 4 or 8 bytes. Seems to yield
0-6% improvements in performance in the benchmarks I've run.
For example, with the regexp benchmarks:

Before:
regexp.BenchmarkLiteral   500000       3.26 µs/op
regexp.BenchmarkNotLiteral    100000      13.67 µs/op
regexp.BenchmarkMatchClass    100000      18.72 µs/op
regexp.BenchmarkMatchClass_InRange    100000      20.04 µs/op
regexp.BenchmarkReplaceAll    100000      27.85 µs/op

After:
regexp.BenchmarkLiteral   500000       3.11 µs/op
regexp.BenchmarkNotLiteral    200000      13.29 µs/op
regexp.BenchmarkMatchClass    100000      17.65 µs/op
regexp.BenchmarkMatchClass_InRange    100000      18.49 µs/op
regexp.BenchmarkReplaceAll    100000      26.34 µs/op

R=rsc
CC=golang-dev
https://golang.org/cl/1967047
2010-08-26 13:32:40 -04:00
Jukka-Pekka Kekkonen
ba5b09f786 crypto/hmac: make Sum idempotent
Fixes #978.

R=rsc
CC=golang-dev
https://golang.org/cl/1967045
2010-08-26 13:32:29 -04:00
Evan Shaw
33cb46903e net/textproto: Handle multi-line responses
This is required for FTP and SMTP; maybe others.

R=rsc
CC=golang-dev
https://golang.org/cl/1892052
2010-08-26 13:32:23 -04:00
Scott Lawrence
6752ce9331 http: obscure passwords in return value of URL.String
Fixes #974.

R=rsc
CC=golang-dev
https://golang.org/cl/1742057
2010-08-26 13:32:16 -04:00
Ian Lance Taylor
bbaef5f4dc runtime: Correct commonType.kind values to match compiler.
The copy of these values in the reflect package is already
correct.

R=rsc
CC=golang-dev
https://golang.org/cl/2009044
2010-08-26 08:08:57 -07:00
Russ Cox
15f336b675 build: let pkg/Makefile coordinate building of Go commands
Commands written in Go depend on Go packages, so they
cannot be built by src/cmd/make.bash.  They have been
built by src/make.bash after all the packages are done, but
we want to be able to use cgo (written in Go) during the build
of package net.  To make this possible, build the commands
from src/pkg/Makefile instead of src/make.bash, so that they
are included in the package dependency analysis.

R=r
CC=golang-dev
https://golang.org/cl/1972046
2010-08-25 17:54:10 -04:00
Jukka-Pekka Kekkonen
9401e3d1e4 websocket: fix missing Sec-WebSocket-Protocol on server response.
Due to header key normalization/typo, the server never responds with
the protocol header in place. This breaks all (draft76) applications
that are using the protocol-header.

R=ukai, rsc
CC=golang-dev
https://golang.org/cl/1969046
2010-08-25 12:52:04 -04:00
Martin Neubauer
9a04cba807 src/pkg/Makefile: delete use of QUOTED_GOBIN
R=rsc
CC=golang-dev
https://golang.org/cl/1997044
2010-08-25 12:44:13 -04:00
Russ Cox
b0729cdfe5 go/doc: use correct escaper for URL
Despite the name, URL escaping is for a small subpiece of the URL only.
This particular URL is being emitted in an <a href=""> tag and in that
context it should be HTML escaped, not URL escaped.

In addition to fixing a bug, this change cuts a dependency chain
from go/doc to net, clearing the way for use of cgo
(which imports go/doc) during the compilation of package net.

R=gri
CC=golang-dev
https://golang.org/cl/1960050
2010-08-25 11:00:38 -04:00
Russ Cox
218afb8fbd syscall: change BUG(brainman) to NOTE(brainman)
Avoids the comment appearing in godoc syscall BUGS section.

R=brainman
CC=golang-dev
https://golang.org/cl/1966048
2010-08-25 01:26:35 -04:00
Rob Pike
d7736413a6 scanner: change package comment to be clearer about its functionality.
No semantic changes.

R=gri, rsc1
CC=golang-dev
https://golang.org/cl/1998045
2010-08-25 13:07:08 +10:00
Ian Lance Taylor
2b73ad592c time: Remove unused zoneinfo.go (replaced by zoneinfo_unix.go).
R=r, rsc
CC=brainman, golang-dev
https://golang.org/cl/2020043
2010-08-24 17:24:40 -07:00
Jan H. Hosang
2100f57e0f time.Parse should not require minutes for time zone
Fixes #1026.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1962048
2010-08-25 07:41:26 +10:00
Russ Cox
e1e829b786 runtime: fix freebsd/386 mmap
The runtime only passes 32 bits of file offset,
but the kernel wants 64 bits, so have to add
zeros explicitly in a copy of the arguments.

R=adg, Martin Neubauer
CC=golang-dev
https://golang.org/cl/1933044
2010-08-24 13:04:02 -04:00
Scott Lawrence
668f05aaf1 os: make return type of FileInfo.Permission() consistent with related functions
(uint32 rather than int)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1958048
2010-08-24 10:38:52 +10:00
Russ Cox
d0459447fa http: doc nit
R=r
CC=golang-dev
https://golang.org/cl/2013043
2010-08-23 18:06:28 -04:00
Kai Backman
534dbc738f arm: fix build, regenerate syscall files
R=r
CC=golang-dev
https://golang.org/cl/1952046
2010-08-23 13:25:14 +03:00
Andrew Gerrand
4642708984 io: prevent ReadAtLeast spinloop if min > len(buf)
R=r, heresy.mc
CC=golang-dev
https://golang.org/cl/2017042
2010-08-23 12:04:15 +10:00
Scott Lawrence
d125faeed0 net/ipsock.go: fix error checking bug
Check oserr, not err for non-nil (err is never changed)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1965042
2010-08-22 22:12:56 +10:00
Scott Lawrence
e5518feaf8 http: fix typo in http.Request documentation
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/2004044
2010-08-22 14:44:00 +10:00
Robert Griesemer
dbbe32ee53 fix build
Also: Copyright notices only need the year the file was created.

R=rsc
CC=golang-dev, krasin
https://golang.org/cl/2021041
2010-08-20 11:20:12 -07:00
Ivan Krasin
5a0274399a syscall: regenerate syscall/z* files for linux/386, linux/amd64
DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS"

Use <sys/user.h> instead of <linux/user.h>
See http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00834.html for more details.

R=imkrasin, rsc
CC=golang-dev
https://golang.org/cl/1957041
2010-08-20 09:12:21 -04:00
Robert Griesemer
1a667f52d8 go/ast Fprint: handle cycles in AST
Augmented ASTs may contain cycles. Keep
track of already printed objects and refer
to them with a line number instead of
printing them again.

R=rsc
CC=golang-dev
https://golang.org/cl/1998042
2010-08-19 16:03:02 -07:00
Rob Pike
9d3eb29a29 mime: delete unnecessary constant conversions.
R=rsc
CC=golang-dev
https://golang.org/cl/1984043
2010-08-20 07:42:02 +10:00