]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agocodereview: fix clpatch
Russ Cox [Fri, 13 May 2011 03:11:52 +0000 (23:11 -0400)]
codereview: fix clpatch

TBR=gri
CC=golang-dev
https://golang.org/cl/4534052

13 years agoimage/tiff: Reject images with SampleFormat != 1.
Benny Siegert [Fri, 13 May 2011 02:34:48 +0000 (22:34 -0400)]
image/tiff: Reject images with SampleFormat != 1.

The TIFF spec says that a baseline TIFF reader must gracefully terminate
when the image has a SampleFormat tag which it does not support.
For baseline compatibility, only SampleFormat=1 (the default) is needed.
Images with other sample formats (e.g. floating-point color values)
are very rare in practice.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4515073

13 years agohtml: parse empty, unquoted, and single-quoted attribute values
Brad Fitzpatrick [Thu, 12 May 2011 23:11:35 +0000 (16:11 -0700)]
html: parse empty, unquoted, and single-quoted attribute values

Fixes #1391

R=nigeltao
CC=golang-dev
https://golang.org/cl/4453054

13 years agogo spec: clarify semantics of range clause
Robert Griesemer [Thu, 12 May 2011 16:15:59 +0000 (09:15 -0700)]
go spec: clarify semantics of range clause

This CL proposes some subtle language changes
in an attempt to clarify the semantics of range
clauses and simplify uses of maps.

- nil maps behave like empty maps; but attempting
  to set a value in a nil map causes a run-time panic
- nil channels are never ready for communication;
  sending or reading from a nil channel blocks forever
- if there is only one index iteration variable in a
  range clause and len(range expression) would be a constant,
  the range expression is not evaluated.
  (was discrepancy with len/cap before)
- the notion of what is a constant expression len(x)
  for (pointer to) arrays x has been generalized and
  simplified (can still be syntactically decided)
  (before: more restrictive syntactic rule that was not
  consistently implemented)

Fixes #1713.

R=r, rsc, iant, ken2, r2, bradfitz, rog
CC=golang-dev
https://golang.org/cl/4444050

13 years agogo/printer: more accurate comment for incomplete structs/interfaces
Robert Griesemer [Thu, 12 May 2011 16:01:50 +0000 (09:01 -0700)]
go/printer: more accurate comment for incomplete structs/interfaces

A struct or interface type node is marked incomplete if fields or
methods have been removed through any kind of filtering, not just
because entries are not exported.

The current message was misleading in some cases (for instance:
"godoc -src reflect Implements").

This CL requires CL 4527050 .

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4529054

13 years agogo/ast: consider anonymous fields and set Incomplete bit when filtering ASTs
Robert Griesemer [Thu, 12 May 2011 16:01:32 +0000 (09:01 -0700)]
go/ast: consider anonymous fields and set Incomplete bit when filtering ASTs

Also:
- fieldListExports: don't require internal pointer to StructType/InterfaceType node
- filterFieldLists: make structure match fieldListExports

R=rsc
CC=golang-dev
https://golang.org/cl/4527050

13 years agogo/doc, godoc: when filtering for godoc, don't remove elements of a declaration
Robert Griesemer [Thu, 12 May 2011 16:01:10 +0000 (09:01 -0700)]
go/doc, godoc: when filtering for godoc, don't remove elements of a declaration

Partially revert CL 4518050. In go/doc.go, instead of calling the go/ast filter
functions, implement the corresponding match functions that do no remove
declaration elements.

Fixes #1803.

R=rsc
CC=golang-dev
https://golang.org/cl/4517055

13 years agodashboard: fix for branches
Russ Cox [Thu, 12 May 2011 15:21:34 +0000 (11:21 -0400)]
dashboard: fix for branches

In the new world, one builder runs
        gobuilder -commit
which uploads information about commits to the dashboard,
which then hands the work out to the builders by hash.
There is no assumption anymore that the commit numbers
are consistent across builders.

New builders will need to be deployed.  For now darwin-amd64
is running the new builder to test the code.

The new JSON-based protocol for handing out work via /todo
should be easy to extend if we want to add support for sending
trial CLs to the builders.

This code is already running on godashboard.appspot.com.

R=adg, dave
CC=golang-dev
https://golang.org/cl/4519047

13 years agodoc/codelab: correct typo.
Johan Euphrosine [Thu, 12 May 2011 15:21:10 +0000 (11:21 -0400)]
doc/codelab: correct typo.

s/Sprintf/Fprintf/

R=golang-dev, rsc
CC=adg, golang-dev
https://golang.org/cl/4519053

13 years agoCONTRIBUTORS: add Johan Euphrosine (Google CLA)
Russ Cox [Thu, 12 May 2011 15:21:00 +0000 (11:21 -0400)]
CONTRIBUTORS: add Johan Euphrosine (Google CLA)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4515070

13 years ago5l, 8l: add ELF symbol table to binary
Russ Cox [Thu, 12 May 2011 03:59:36 +0000 (23:59 -0400)]
5l, 8l: add ELF symbol table to binary

Should have been added long ago.
Thanks to Alex Brainman for noticing.

R=ken2
CC=golang-dev
https://golang.org/cl/4538046

13 years agold: fix alignment of rodata section on Plan 9
Anthony Martin [Thu, 12 May 2011 03:52:05 +0000 (23:52 -0400)]
ld: fix alignment of rodata section on Plan 9

This was causing a panic in the reflect package
since type.* pointers with their low bits set are
assumed to have certain flags set that disallow
the use of reflection.

Thanks to Pavel and Taru for help tracking down
this bug.

R=rsc, paulzhol, taruti
CC=golang-dev
https://golang.org/cl/4511041

13 years agogc: fix type switch error message for invalid cases.
Lorenzo Stoakes [Thu, 12 May 2011 03:41:59 +0000 (23:41 -0400)]
gc: fix type switch error message for invalid cases.

Fixes #1606.

R=rsc
CC=golang-dev
https://golang.org/cl/4532045

13 years agocodereview: fetch metadata using JSON API, not XML scraping
Russ Cox [Thu, 12 May 2011 03:26:52 +0000 (23:26 -0400)]
codereview: fetch metadata using JSON API, not XML scraping

Fixes hg clpatch.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/4524045

13 years agomake: add nuke target for C commands and libs
Anthony Martin [Thu, 12 May 2011 02:53:42 +0000 (22:53 -0400)]
make: add nuke target for C commands and libs

Also, clean *.out files for commands written in Go.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4535051

13 years agohttp: fix two Transport gzip+persist crashes
Brad Fitzpatrick [Thu, 12 May 2011 02:33:15 +0000 (22:33 -0400)]
http: fix two Transport gzip+persist crashes

There were a couple issues:

-- HEAD requests were attempting to be ungzipped,
   despite having no content.  That was fixed in
   the previous patch version, but ultimately was
   fixed as a result of other refactoring:

-- persist.go's ClientConn "lastbody" field was
   remembering the wrong body, since we were
   mucking with it later. Instead, ditch
   ClientConn's readRes func field and add a new
   method passing it in, so we can use a closure
   and do all our bodyEOFSignal + gunzip stuff
   in one place, simplifying a lot of code and
   not requiring messing with ClientConn's innards.

-- closing the gzip reader didn't consume its
   contents.  if the caller wasn't done reading
   all the response body and ClientConn closed it
   (thinking it'd move past those bytes in the
   TCP stream), it actually wouldn't.  so introduce
   a new wrapper just for gzip reader to have its
   Close method do an ioutil.Discard on its body
   first, before the close.

Fixes #1725
Fixes #1804

R=rsc, eivind
CC=golang-dev
https://golang.org/cl/4523058

13 years agocompress/zlib: actually use provided dictionary.
Adam Langley [Wed, 11 May 2011 21:00:19 +0000 (17:00 -0400)]
compress/zlib: actually use provided dictionary.

R=rsc, bradfitz, bradfitzgoog
CC=golang-dev
https://golang.org/cl/4518056

13 years agohttp: write cookies according to RFC 6265
Christian Himpel [Wed, 11 May 2011 20:33:27 +0000 (13:33 -0700)]
http: write cookies according to RFC 6265

RFC 6265 requires that user agents MUST NOT send more than
one Cookie header in a request.

Note, this change also fixes an issue when sending requests
with more than one cookie header line to a php script served
by an apache web server.  Apache concatenates the cookies
with ", ", but php tries to split them only at ";".  E.g.
two cookies: "a=b, c=d" are seen by php as one cookie "a"
with the value "b, c=d".

Fixes #1801

R=bradfitz
CC=golang-dev
https://golang.org/cl/4535048

13 years agohttp: fix transport bug with zero-length bodies
Brad Fitzpatrick [Wed, 11 May 2011 19:11:32 +0000 (12:11 -0700)]
http: fix transport bug with zero-length bodies

An optimization in Transport which re-uses TCP
connections early in the case where there is
no response body interacted poorly with
ErrBodyReadAfterClose.  Upon recycling the TCP
connection early we would Close the Response.Body
(in case the user forgot to), but in the case
of a zero-lengthed body, the user's handler might
not have run yet.

This CL makes sure the Transport doesn't try
to Close requests when we're about to immediately
re-use the TCP connection.

This also includes additional tests I wrote
while debugging.

R=rsc, bradfitzgoog
CC=golang-dev
https://golang.org/cl/4529050

13 years agoimage/bmp: implement a BMP decoder.
Nigel Tao [Wed, 11 May 2011 18:12:45 +0000 (11:12 -0700)]
image/bmp: implement a BMP decoder.

R=r
CC=golang-dev
https://golang.org/cl/4521054

13 years agoimage/gif: minor fixes.
Nigel Tao [Wed, 11 May 2011 18:11:25 +0000 (11:11 -0700)]
image/gif: minor fixes.

R=r
CC=golang-dev
https://golang.org/cl/4523054

13 years agoeffective go: explain about values/pointers in String() example
Rob Pike [Wed, 11 May 2011 15:31:24 +0000 (08:31 -0700)]
effective go: explain about values/pointers in String() example

Fixes #1796.

R=rsc, r2, niemeyer
CC=golang-dev
https://golang.org/cl/4539049

13 years agocrypto/x509/crl: add package
Adam Langley [Wed, 11 May 2011 14:39:09 +0000 (10:39 -0400)]
crypto/x509/crl: add package

crl parses CRLs and exposes their details. In the future, Verify
should be able to use this for revocation checking.

R=bradfitz
CC=golang-dev
https://golang.org/cl/4485045

13 years agogc: inline append when len<cap
Luuk van Dijk [Wed, 11 May 2011 14:35:11 +0000 (16:35 +0200)]
gc: inline append when len<cap

issue 1604

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4313062

13 years agohttp: don't Clean query string in relative redirects
Brad Fitzpatrick [Wed, 11 May 2011 11:30:05 +0000 (04:30 -0700)]
http: don't Clean query string in relative redirects

R=adg, rsc, kevlar, r
CC=golang-dev
https://golang.org/cl/4476045

13 years agodoc/roadmap: put "App Engine support" under "Done".
Andrew Gerrand [Wed, 11 May 2011 01:40:40 +0000 (18:40 -0700)]
doc/roadmap: put "App Engine support" under "Done".

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4528053

13 years agogc: fix unsafe.Sizeof
Russ Cox [Tue, 10 May 2011 21:00:15 +0000 (17:00 -0400)]
gc: fix unsafe.Sizeof

Fixes #1608.
Fixes #1787.

R=ken2
CC=golang-dev
https://golang.org/cl/4530045

13 years agogo/ast, go/doc, godoc: consider struct fields and interface methods when filtering...
Robert Griesemer [Tue, 10 May 2011 18:09:56 +0000 (11:09 -0700)]
go/ast, go/doc, godoc: consider struct fields and interface methods when filtering ASTs

So far, only top-level names where considered when trimming ASTs
using a filter function. For instance, "godoc reflect Implements"
didn't show the "Implements" method of the type Interface because
the local method name was not considered (on the other hand, "top-
level" declared methods associated with types were considered).

With this CL, AST filter functions look also at struct fields
and interface methods.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4518050

13 years agoruntime: add newline to "finalizer already set" error
Albert Strasheim [Tue, 10 May 2011 17:47:56 +0000 (13:47 -0400)]
runtime: add newline to "finalizer already set" error

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4523047

14 years agoimage/jpeg: speed up decoding by inlining the clip function and
Nigel Tao [Tue, 10 May 2011 00:25:32 +0000 (17:25 -0700)]
image/jpeg: speed up decoding by inlining the clip function and
writing the idct result directly to the image buffer instead of
storing it in an intermediate d.blocks field.

Writing to d.blocks was necessary when decoding to an image.RGBA image,
but now that we decode to a ycbcr.YCbCr we can write each component
directly to the image buffer.

Crude "time ./6.out" scores to decode a specific 2592x1944 JPEG 20
times show a 16% speed-up:

BEFORE

user 0m10.410s
user 0m10.400s
user 0m10.480s
user 0m10.480s
user 0m10.460s

AFTER

user 0m9.050s
user 0m9.050s
user 0m9.050s
user 0m9.070s
user 0m9.020s

R=r
CC=golang-dev
https://golang.org/cl/4523052

14 years agogo/printer, gofmt: fix alignment of "=" in const/var declarations
Robert Griesemer [Mon, 9 May 2011 22:16:34 +0000 (15:16 -0700)]
go/printer, gofmt: fix alignment of "=" in const/var declarations

gofmt -w src misc

Fixes #1414.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4456054

14 years agogo/parser: always introduce an ast.Object when declaring an identifier
Robert Griesemer [Mon, 9 May 2011 21:48:05 +0000 (14:48 -0700)]
go/parser: always introduce an ast.Object when declaring an identifier

When traversing parameter lists (e.g. for type checking), we want the
invariant that all identifers have associated objects (even _ idents),
so that we can associate a type with each object.

R=rsc
CC=golang-dev
https://golang.org/cl/4490042

14 years agogif: fix build
Rob Pike [Mon, 9 May 2011 13:38:04 +0000 (06:38 -0700)]
gif: fix build
Had bit test wrong on transparency; no excuses.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4526044

14 years agoimage/gif: implement transparency.
Rob Pike [Mon, 9 May 2011 00:26:16 +0000 (17:26 -0700)]
image/gif: implement transparency.

At least, as I understand it. The spec is unclear about what happens
with a local color map.

R=nigeltao, r2
CC=golang-dev
https://golang.org/cl/4515045

14 years agogo spec: fix up HTML glitches.
Rob Pike [Sun, 8 May 2011 21:05:18 +0000 (14:05 -0700)]
go spec: fix up HTML glitches.

Fixes #1786.

R=gri, adg
CC=golang-dev
https://golang.org/cl/4517043

14 years agoeffective go: update to new Open signature.
Rob Pike [Sun, 8 May 2011 21:04:42 +0000 (14:04 -0700)]
effective go: update to new Open signature.
Fixes #1788.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4519042

14 years agosyscall: change Overlapped.HEvent type, it is a handle
Alex Brainman [Sun, 8 May 2011 06:33:44 +0000 (16:33 +1000)]
syscall: change Overlapped.HEvent type, it is a handle

R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/4471046

14 years agosyscall: fix bug in mksyscall_windows.pl
Alex Brainman [Sun, 8 May 2011 06:32:00 +0000 (16:32 +1000)]
syscall: fix bug in mksyscall_windows.pl

This change fixes generation of "shadow" variables for bool parameters.
Before the change, it was naming all bool variables with the same name of _p0.
Now it calls them _p0, _p1, ... So the code could compile.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4479047

14 years agoimage/gif: GIF decoder
Rob Pike [Sun, 8 May 2011 05:57:42 +0000 (22:57 -0700)]
image/gif: GIF decoder

It's incomplete but sufficient to decode 8-bit GIFs without interlacing
or transparency.   More to come.

I'll put in more tests as the feature set grows.

R=nigeltao, r2
CC=golang-dev
https://golang.org/cl/4522041

14 years agocompress/lzw: silently drop implied codes that are too large,
Nigel Tao [Sun, 8 May 2011 01:57:32 +0000 (18:57 -0700)]
compress/lzw: silently drop implied codes that are too large,
instead of returning an error.

For example, http://www.w3.org/Graphics/GIF/spec-gif89a.txt
explicitly says that GIF encoders can use a full table as is,
without needing to send a clear code.

R=r, dsymonds, nigeltao_gnome, r2
CC=golang-dev
https://golang.org/cl/4518041

14 years agogob: Doc typo fix
Anschel Schaffer-Cohen [Sat, 7 May 2011 18:05:08 +0000 (11:05 -0700)]
gob: Doc typo fix
Fixes #1785.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4496042

14 years agowindows: reset command var to sh for correct error output messages
Joe Poirier [Sat, 7 May 2011 05:05:04 +0000 (22:05 -0700)]
windows: reset command var to sh for correct error output messages

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4492043

14 years agocgo: put CFLAGS before filename argument
Roger Peppe [Fri, 6 May 2011 20:35:51 +0000 (13:35 -0700)]
cgo: put CFLAGS before filename argument
This means that the -x flag can work, which could enable
support for other languages (e.g. objective-C).

R=iant, rsc
CC=golang-dev
https://golang.org/cl/4476049

14 years agodoc: remove left and right padding in H2 headings.
Dmitry Chestnykh [Fri, 6 May 2011 20:11:07 +0000 (16:11 -0400)]
doc: remove left and right padding in H2 headings.

R=adg, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4491041

14 years agoruntime: handle out-of-threads on Linux gracefully
Albert Strasheim [Fri, 6 May 2011 19:29:49 +0000 (15:29 -0400)]
runtime: handle out-of-threads on Linux gracefully

R=rsc
CC=golang-dev
https://golang.org/cl/4396050

14 years agohttp: fix typo in URL.String doc comment.
David Symonds [Fri, 6 May 2011 17:00:50 +0000 (10:00 -0700)]
http: fix typo in URL.String doc comment.

R=adg
CC=golang-dev
https://golang.org/cl/4485046

14 years agowingui: fix Makefile after rename
Alex Brainman [Fri, 6 May 2011 07:15:46 +0000 (17:15 +1000)]
wingui: fix Makefile after rename

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4477046

14 years agocrypto/tls: export the verified chains.
Adam Langley [Thu, 5 May 2011 17:44:36 +0000 (13:44 -0400)]
crypto/tls: export the verified chains.

The verified chains are the chains that were actually verified.

R=bradfitz
CC=golang-dev
https://golang.org/cl/4462046

14 years agocrypto/x509: export raw SubjectPublicKeyInfo.
Adam Langley [Thu, 5 May 2011 17:37:42 +0000 (13:37 -0400)]
crypto/x509: export raw SubjectPublicKeyInfo.

The SPKI will probably be used for identifying public keys in future
HSTS specs.

R=bradfitz
CC=golang-dev
https://golang.org/cl/4485044

14 years agoimage: make AlphaColor.Set conform to usual signature
Roger Peppe [Thu, 5 May 2011 17:16:59 +0000 (10:16 -0700)]
image: make AlphaColor.Set conform to usual signature

R=nigeltao, r
CC=golang-dev
https://golang.org/cl/4471045

14 years agogo spec: newlines cannot be used inside a char or "" string literal
Robert Griesemer [Thu, 5 May 2011 16:03:00 +0000 (09:03 -0700)]
go spec: newlines cannot be used inside a char or "" string literal

R=r
CC=golang-dev
https://golang.org/cl/4462043

14 years agoimage/tiff: implement a decoder.
Benny Siegert [Thu, 5 May 2011 03:52:55 +0000 (20:52 -0700)]
image/tiff: implement a decoder.

The current iteration can decode 8-bit images in
grayscale, paletted, RGB, RGBA and NRGBA mode. LZW compression
is implemented but does not work on my test images.
Deflate (i.e. zlib) compression with or without a horizontal
predictor is supported.

R=nigeltao, nigeltao_gnome
CC=golang-dev, mpl
https://golang.org/cl/4240051

14 years agoimage/png: support encoding of paletted images with alpha channel.
Dmitry Chestnykh [Thu, 5 May 2011 03:46:27 +0000 (20:46 -0700)]
image/png: support encoding of paletted images with alpha channel.

Encoder now writes tRNS chunk for non-opaque paletted images.
CL includes new test images (basn3a08-trns.[ps]ng).

R=nigeltao, rsc, r
CC=golang-dev
https://golang.org/cl/4432078

14 years agohttp/spdy: add type to FlagClearPreviouslyPersistedSettings constant
Ross Light [Wed, 4 May 2011 19:01:33 +0000 (15:01 -0400)]
http/spdy: add type to FlagClearPreviouslyPersistedSettings constant

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4436074

14 years agoexp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.
Nigel Tao [Wed, 4 May 2011 17:17:53 +0000 (10:17 -0700)]
exp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.

On my laptop, I had an 800x600 jpeg and an 800x600 png (with
transparency). I timed how long it took to draw each image onto an
equivalently sized, zeroed RGBA image.

Previously, the jpeg took 75ms and the png took 70ms, going through
the medium-fast path, i.e. func drawRGBA in draw.go.

After this CL, the jpeg took 14ms, and the png took 21ms with the
Over operator and 12ms with the Src operator.

It's only a rough estimate basd on one image file, but it should
give an idea of the order of magnitude of improvement.

R=rsc, r
CC=adg, golang-dev
https://golang.org/cl/4468044

14 years agotag release.r57.1
Russ Cox [Wed, 4 May 2011 04:26:20 +0000 (00:26 -0400)]
tag release.r57.1

R=adg
CC=golang-dev
https://golang.org/cl/4468043

14 years agodoc: document r57.1
Russ Cox [Wed, 4 May 2011 04:14:07 +0000 (00:14 -0400)]
doc: document r57.1

R=adg
CC=golang-dev
https://golang.org/cl/4471041

14 years agohttp: fix FormFile nil pointer dereference on missing multipart form
Andrew Gerrand [Wed, 4 May 2011 03:45:10 +0000 (20:45 -0700)]
http: fix FormFile nil pointer dereference on missing  multipart form

R=rsc
CC=golang-dev
https://golang.org/cl/4463042

14 years agonet: disable dnsmsg_test on windows
Alex Brainman [Wed, 4 May 2011 03:08:36 +0000 (13:08 +1000)]
net: disable dnsmsg_test on windows

R=golang-dev, bradfitzwork
CC=golang-dev
https://golang.org/cl/4466041

14 years agomake.bash: remove old bash version of gotest on Windows
Alex Brainman [Wed, 4 May 2011 01:16:55 +0000 (11:16 +1000)]
make.bash: remove old bash version of gotest on Windows

The file is called gotest.exe now.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4444090

14 years agohttp: improve a test
Brad Fitzpatrick [Tue, 3 May 2011 18:25:35 +0000 (11:25 -0700)]
http: improve a test

Should prevent failures on slow machines, such as:
http://godashboard.appspot.com/log/47b5cae591b7ad8908704e327f3b9b41945d7d5fecfc0c8c945d5545ece1a813

Verified the change (on a fast machine) by removing the
existing sleep, in which case the race happens ~50% of the
time with GOMAXPROCS > 1, but recovers gracefully with
retries.

R=rsc
CC=golang-dev
https://golang.org/cl/4441089

14 years agotag release.r57 step 2
Russ Cox [Tue, 3 May 2011 18:12:46 +0000 (14:12 -0400)]
tag release.r57 step 2

R=r
CC=golang-dev
https://golang.org/cl/4431088

14 years agotag release.r57
Russ Cox [Tue, 3 May 2011 18:12:02 +0000 (14:12 -0400)]
tag release.r57

R=r, r2
CC=golang-dev
https://golang.org/cl/4435083

14 years agodoc: release.r57
Russ Cox [Tue, 3 May 2011 17:55:50 +0000 (13:55 -0400)]
doc: release.r57

R=golang-dev, r, adg, r2
CC=golang-dev
https://golang.org/cl/4457049

14 years agogofmt: update test.sh (exclude a file w/ incorrect syntax)
Robert Griesemer [Tue, 3 May 2011 16:56:18 +0000 (09:56 -0700)]
gofmt: update test.sh (exclude a file w/ incorrect syntax)

R=iant, iant2
CC=golang-dev
https://golang.org/cl/4453058

14 years agocodereview: add release branch support
Russ Cox [Tue, 3 May 2011 14:39:11 +0000 (10:39 -0400)]
codereview: add release branch support

Note that if you are working on the upcoming release
branch you have to point your extension path to a
copy of lib/codereview/codereview.py that won't change
as the repository flips between release-branch and default branch.
This warning should only apply to this one branch and only to rsc,
but you never know.

R=adg
CC=golang-dev
https://golang.org/cl/4446076

14 years agoreflect: allow unexported key in Value.MapIndex
Russ Cox [Tue, 3 May 2011 14:38:37 +0000 (10:38 -0400)]
reflect: allow unexported key in Value.MapIndex

Fixes #1748.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4444087

14 years agonet: don't crash on unexpected DNS SRV responses
Brad Fitzpatrick [Tue, 3 May 2011 14:10:48 +0000 (07:10 -0700)]
net: don't crash on unexpected DNS SRV responses

Fixes #1350

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4432089

14 years agoMake.cmd: create TARGDIR if necessary
Gustavo Niemeyer [Tue, 3 May 2011 12:53:04 +0000 (09:53 -0300)]
Make.cmd: create TARGDIR if necessary

Fixes #1771.

R=adg, rsc1
CC=golang-dev
https://golang.org/cl/4437089

14 years agold: make ELF binaries with no shared library dependencies static binaries
Russ Cox [Tue, 3 May 2011 05:56:23 +0000 (01:56 -0400)]
ld: make ELF binaries with no shared library dependencies static binaries

$ file $GOROOT/bin/{godoc,goyacc}
/home/rsc/g/go/bin/godoc:  ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not strpped
/home/rsc/g/go/bin/goyacc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
$

Fixes #1758.

R=iant
CC=golang-dev
https://golang.org/cl/4428079

14 years agodoc/install: specify clone -u instead of -r
Andrew Gerrand [Tue, 3 May 2011 03:40:47 +0000 (20:40 -0700)]
doc/install: specify clone -u instead of -r

R=rsc
CC=golang-dev
https://golang.org/cl/4435081

14 years agoos: remove race paranoia from Environ(); it's guarded now
Brad Fitzpatrick [Tue, 3 May 2011 03:08:27 +0000 (23:08 -0400)]
os: remove race paranoia from Environ(); it's guarded now

R=rsc
CC=golang-dev
https://golang.org/cl/4426077

14 years agogodoc: if there is no search box, don't run the respective JS code
Robert Griesemer [Tue, 3 May 2011 01:07:11 +0000 (18:07 -0700)]
godoc: if there is no search box, don't run the respective JS code

Fixes a JS crash which prevented the automatically generated
table of contents to not appear.

R=adg, bradfitz
CC=golang-dev
https://golang.org/cl/4460041

14 years agogo spec: clarify semantics of integer division
Robert Griesemer [Tue, 3 May 2011 00:23:18 +0000 (17:23 -0700)]
go spec: clarify semantics of integer division

Fixes #1764.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/4431082

14 years agoimage: fix build
Rob Pike [Mon, 2 May 2011 22:42:46 +0000 (15:42 -0700)]
image: fix build
accidentally deleted one method
TBR=rsc

R=rsc
CC=golang-dev
https://golang.org/cl/4438090

14 years agoimage: add type-specific Set methods and use them when decoding PNG.
Rob Pike [Mon, 2 May 2011 22:10:37 +0000 (15:10 -0700)]
image: add type-specific Set methods and use them when decoding PNG.
This speeds up PNG decode about 20% by avoiding per-pixel interface conversions.

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/4428080

14 years agohttp/pprof: fix POST reading bug
Russ Cox [Mon, 2 May 2011 21:34:22 +0000 (17:34 -0400)]
http/pprof: fix POST reading bug

R=bradfitz
CC=golang-dev
https://golang.org/cl/4430075

14 years agonet: default to 127.0.0.1, not localhost, in TestICMP
Brad Fitzpatrick [Mon, 2 May 2011 21:22:40 +0000 (14:22 -0700)]
net: default to 127.0.0.1, not localhost, in TestICMP

If localhost resolves to ::1, the IPv4-only test fails.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4444084

14 years agoruntime: maybe fix Windows build broken by cgo setenv CL
Brad Fitzpatrick [Mon, 2 May 2011 20:35:28 +0000 (13:35 -0700)]
runtime: maybe fix Windows build broken by cgo setenv CL

R=rsc
CC=golang-dev
https://golang.org/cl/4428078

14 years agogodoc: added -index flag to enable/disable search index
Robert Griesemer [Mon, 2 May 2011 20:28:02 +0000 (13:28 -0700)]
godoc: added -index flag to enable/disable search index

Fixes #1647.

R=adg, rsc1, r2, rsc, r
CC=golang-dev
https://golang.org/cl/4444083

14 years agohttp: fix racy test with a simpler version
Brad Fitzpatrick [Mon, 2 May 2011 20:01:36 +0000 (13:01 -0700)]
http: fix racy test with a simpler version

This was seen breaking the slow arm5 builder:
http://godashboard.appspot.com/log/ec54ee302a70c07093e8f5c47454b3eb48768b77e1d8cc7943d8951f8b6696be

The test was unnecessarily complex and didn't benefit from
using httptest.Server. That just got in the way.

R=rsc
CC=golang-dev
https://golang.org/cl/4439088

14 years agoos: make Setenv update C environment variables
Brad Fitzpatrick [Mon, 2 May 2011 19:38:13 +0000 (12:38 -0700)]
os: make Setenv update C environment variables

Fixes #1569

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4456045

14 years agomisc/cgo/test: run tests
Russ Cox [Mon, 2 May 2011 17:55:51 +0000 (13:55 -0400)]
misc/cgo/test: run tests

The new gotest ignores Test functions outside *_test.go files
(the old shell script allowed them), so replace one clumsy hack
with another.

The root problem is that the package makefiles only know
how to run cgo for source files in the package proper, not
for test files.  Making it work for test files is probably more
trouble than it's worth.

R=bradfitz
CC=golang-dev
https://golang.org/cl/4452060

14 years agogo/printer: make tests follow syntactic restrictions
Robert Griesemer [Mon, 2 May 2011 17:05:43 +0000 (10:05 -0700)]
go/printer: make tests follow syntactic restrictions

R=rsc
CC=golang-dev
https://golang.org/cl/4439087

14 years agogo/token: faster FileSet.Position implementation
Robert Griesemer [Mon, 2 May 2011 16:17:46 +0000 (09:17 -0700)]
go/token: faster FileSet.Position implementation

- added a cache for last file looked up: avoids binary
  search if the file matches

- don't look up extra line info if not present
  (it is almost never present)

- inline one critical binary search call (inlining
  provides almost 30% improvement in this case)

Together, these changes make the go/printer benchmark
more than twice as fast (53% improvement). gofmt also
sped up by about the same amount.

Also: removed an unused internal field from FileSet.

Measurements (always best of 5 runs):

* original:
  printer.BenchmarkPrint     5    238354200 ns/op (100%)

* using last file cache:
  printer.BenchmarkPrint    10    201796600 ns/op (85%)

* avoiding lookup of extra line info:
  printer.BenchmarkPrint    10    157072700 ns/op (66%)

* inlining a critical binary search call:
  printer.BenchmarkPrint    10    111523500 ns/op (47%)

gofmt (always best of 3 runs):

* before:
  time gofmt -l src misc
  real 0m33.316s
  user 0m31.298s
  sys 0m0.319s

* after:
  time gofmt -l src misc
  real 0m15.889s
  user 0m14.596s
  sys 0m0.224s

R=r, dfc, bradfitz, rsc1
CC=golang-dev
https://golang.org/cl/4433086

14 years agogo spec: restricted expressions may still be parenthesized
Robert Griesemer [Mon, 2 May 2011 16:16:31 +0000 (09:16 -0700)]
go spec: restricted expressions may still be parenthesized

No language change.

- added a few examples with parentheses
- added a corresponding sentence to assignments
  (this explicitly permits: (_) = 0, currently allowed by 6g,
  gofmt, but marked as an error by gccgo).

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/4446071

14 years ago5a, 6a, 8a, cc: remove old environment variables
Russ Cox [Mon, 2 May 2011 15:24:32 +0000 (11:24 -0400)]
5a, 6a, 8a, cc: remove old environment variables

Uses of $INCLUDE and $NPROC are left over from Plan 9.
Remove them to avoid causing confusion.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4445079

14 years agomultipart: add FileName accessor on Part
Brad Fitzpatrick [Mon, 2 May 2011 15:14:31 +0000 (08:14 -0700)]
multipart: add FileName accessor on Part

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4426074

14 years agonet: enable SO_REUSEPORT on BSD variants
Mikio Hara [Mon, 2 May 2011 14:50:12 +0000 (10:50 -0400)]
net: enable SO_REUSEPORT on BSD variants

Fixes #1694.

R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4445067

14 years agonet: fix ipv6 test
Mikio Hara [Mon, 2 May 2011 14:49:42 +0000 (10:49 -0400)]
net: fix ipv6 test

Fixes #1767.

R=rsc
CC=golang-dev
https://golang.org/cl/4436073

14 years agoruntime, sync/atomic: fix arm cas
Russ Cox [Mon, 2 May 2011 14:49:19 +0000 (10:49 -0400)]
runtime, sync/atomic: fix arm cas

Works around bug in kernel implementation on old ARM5 kernels.
Bug was fixed on 26 Nov 2007 (between 2.6.23 and 2.6.24) but
old kernels persist.

Fixes #1750.

R=dfc, golang-dev
CC=golang-dev
https://golang.org/cl/4436072

14 years agojpeg: speed up RGBA encoding ~%50
Brad Fitzpatrick [Mon, 2 May 2011 14:26:40 +0000 (07:26 -0700)]
jpeg: speed up RGBA encoding ~%50

Avoids image.At(), color.RGBA(), opposing 8 bit shifts,
and min function calls in a loop.  Not as pretty as before,
but the pure version is still there to revert back to
later if/when the compiler gets better.

before (best of 5)
jpeg.BenchmarkEncodeRGBOpaque   50   64781360 ns/op   18.97 MB/s

after (best of 5)
jpeg.BenchmarkEncodeRGBOpaque   50   42044300 ns/op   29.23 MB/s

(benchmarked on an HP z600; 16 core Xeon E5520 @ 2.27Ghz)

R=r, r2, nigeltao
CC=golang-dev
https://golang.org/cl/4433088

14 years agopng: speed up opaque RGBA encoding
Brad Fitzpatrick [Mon, 2 May 2011 14:25:53 +0000 (07:25 -0700)]
png: speed up opaque RGBA encoding

With Linux/8g on a 2006 Mac Mini (1.66 GHz Intel Core Duo,
2KB L1, 2MB L2, 2G main memory), GOMAXPROCS unset:

start:
png.BenchmarkEncodePaletted       50   44772820 ns/op
png.BenchmarkEncodeRGBOpaque       10  208395900 ns/op
png.BenchmarkEncodeRGBA        5  331088000 ns/op

remove interface method calls:
png.BenchmarkEncodePaletted       50   44722880 ns/op
png.BenchmarkEncodeRGBOpaque       10  139042600 ns/op
png.BenchmarkEncodeRGBA        5  334033600 ns/op

flate inline min/max():
png.BenchmarkEncodePaletted       50   40631180 ns/op
png.BenchmarkEncodeRGBOpaque       10  124894900 ns/op
png.BenchmarkEncodeRGBA        5  312099000 ns/op

after adler change:
png.BenchmarkEncodePaletted       50   40181760 ns/op
png.BenchmarkEncodeRGBOpaque       20  121781950 ns/op
png.BenchmarkEncodeRGBA        5  313890800 ns/op

In comparison to 121 ms on this 2006 machine, on my
Core2 Duo 2.66 GHz laptop, the final BenchmarkEncodeRGBOpaque
runs in 27 ms. (these are all for 640x480 images)

R=nigeltao, rsc, r
CC=golang-dev
https://golang.org/cl/4432077

14 years agomultipart: return an error on Reader EOF, not (nil, nil)
Brad Fitzpatrick [Mon, 2 May 2011 01:23:39 +0000 (18:23 -0700)]
multipart: return an error on Reader EOF, not (nil, nil)

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4430074

14 years agosyscall: add Windows file mapping functions and constants
Evan Shaw [Sun, 1 May 2011 23:35:55 +0000 (09:35 +1000)]
syscall: add Windows file mapping functions and constants

R=brainman, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4375046

14 years agohttp: rename ErrBodyReadAferClose to ErrBodyReadAfterClose
Andrew Gerrand [Sun, 1 May 2011 19:37:20 +0000 (12:37 -0700)]
http: rename ErrBodyReadAferClose to ErrBodyReadAfterClose

R=bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/4432085

14 years agomime/multipart: fix regression from previous ReadSlice change
Brad Fitzpatrick [Sun, 1 May 2011 02:54:36 +0000 (19:54 -0700)]
mime/multipart: fix regression from previous ReadSlice change

The previous change to make multipart use ReadSlice out of
paranoia broke multipart to not deal with large lines in
the bodies.

We should only be paranoid about long lines in the header
sections.

Fixes http://code.google.com/p/camlistore/issues/detail?id=4

R=adg
CC=golang-dev
https://golang.org/cl/4432083

14 years agohttp: new error for reading a body after it's been closed
Brad Fitzpatrick [Sun, 1 May 2011 02:54:08 +0000 (19:54 -0700)]
http: new error for reading a body after it's been closed

R=adg
CC=golang-dev
https://golang.org/cl/4433094

14 years agogo/parser: accept parenthesized receive operations in select statements
Robert Griesemer [Fri, 29 Apr 2011 20:06:03 +0000 (13:06 -0700)]
go/parser: accept parenthesized receive operations in select statements

R=rsc
CC=golang-dev
https://golang.org/cl/4439082

14 years agoundo CL 4428057 / 19e540fc7d7d
Robert Griesemer [Fri, 29 Apr 2011 19:20:31 +0000 (12:20 -0700)]
undo CL 4428057 / 19e540fc7d7d

The CL introduces inconsistencies with respect to
the use of parentheses/grouping of receive operations.

««« original CL description
spec: narrow syntax for expression and select statements

This is not a language change, it simply expresses the
accepted cases explicitly in the respective productions.

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/4428057
»»»

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4444080