]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agodoc: add Korean Go site
Andrew Gerrand [Tue, 17 May 2011 04:24:32 +0000 (14:24 +1000)]
doc: add Korean Go site

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

13 years agopkg: fix new incorrect prints found by govet
Robert Hencke [Tue, 17 May 2011 04:15:06 +0000 (21:15 -0700)]
pkg: fix new incorrect prints found by govet

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

13 years agodoc: add I/O 2011 talks to talks/, docs.html, and front page.
Andrew Gerrand [Tue, 17 May 2011 03:46:54 +0000 (13:46 +1000)]
doc: add I/O 2011 talks to talks/, docs.html, and front page.

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

13 years agonet, http: add and make use of IP address scope identification API
Mikio Hara [Tue, 17 May 2011 03:21:13 +0000 (23:21 -0400)]
net, http: add and make use of IP address scope identification API

Add seven methods to IP struct: IsUnspecified, IsLoopback,
IsMulticast, IsInterfaceLocalMulticast, IsLinkLocalMulticast,
IsLinkLocalUnicast and IsGlobalUnicast.

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

13 years agofilepath: make EvalSymlinks work on Windows
Alex Brainman [Tue, 17 May 2011 02:33:36 +0000 (12:33 +1000)]
filepath: make EvalSymlinks work on Windows

Fixes #1830.

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

13 years ago8g: fix conversion from float to uint64
Anthony Martin [Tue, 17 May 2011 02:14:56 +0000 (22:14 -0400)]
8g: fix conversion from float to uint64

The code for converting negative floats was
incorrectly loading an FP control word from
the stack without ever having stored it there.

Thanks to Lars Pensjö for reporting this bug.

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

13 years agoimage/gif: enable images with <8 bits per pixel.
Rob Pike [Mon, 16 May 2011 23:00:41 +0000 (16:00 -0700)]
image/gif: enable images with <8 bits per pixel.

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

13 years agoGIF: support decoding of interlaced images.
Rob Pike [Mon, 16 May 2011 22:17:17 +0000 (15:17 -0700)]
GIF: support decoding of interlaced images.

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

13 years agonet: sort records returned by LookupSRV
Gary Burd [Mon, 16 May 2011 21:48:00 +0000 (17:48 -0400)]
net: sort records returned by LookupSRV

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

13 years agoA+C: Gary Burd (individual CLA)
Russ Cox [Mon, 16 May 2011 21:47:54 +0000 (17:47 -0400)]
A+C: Gary Burd (individual CLA)

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

13 years agodoc/go_mem.html: close happens before receive on closed channel
Russ Cox [Mon, 16 May 2011 21:03:51 +0000 (17:03 -0400)]
doc/go_mem.html: close happens before receive on closed channel

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

13 years agonet: protocol family adaptive address family selection
Mikio Hara [Mon, 16 May 2011 21:03:06 +0000 (17:03 -0400)]
net: protocol family adaptive address family selection

This CL will help to make an adaptive address family
selection possible when an any address family, vague
network string such as "ip", "tcp" or "udp" is passed
to Dial and Listen API.

Fixes #1769.

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

13 years agoruntime: make StackSystem part of StackGuard
Alexey Borzenkov [Mon, 16 May 2011 20:57:49 +0000 (16:57 -0400)]
runtime: make StackSystem part of StackGuard

Fixes #1779

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

13 years agold: do not emit reference to dynamic library named ""
Russ Cox [Mon, 16 May 2011 20:24:17 +0000 (16:24 -0400)]
ld: do not emit reference to dynamic library named ""

Fixes #1778.

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

13 years ago5c, 5g: another attempt at silencing gcc
Russ Cox [Mon, 16 May 2011 20:15:13 +0000 (16:15 -0400)]
5c, 5g: another attempt at silencing gcc

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

13 years ago5l: delete pre-ARMv4 instruction implementations
Russ Cox [Mon, 16 May 2011 20:14:37 +0000 (16:14 -0400)]
5l: delete pre-ARMv4 instruction implementations

Add implementation for addr<->reg short moves.
Align large data, for ARM.

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

13 years agocrypto/x509: support DSA public keys in X.509 certs.
Adam Langley [Mon, 16 May 2011 18:16:48 +0000 (11:16 -0700)]
crypto/x509: support DSA public keys in X.509 certs.

R=agl
CC=golang-dev
https://golang.org/cl/4517072

13 years agoos: fix Windows build from earlier readdir change
Brad Fitzpatrick [Mon, 16 May 2011 17:27:49 +0000 (10:27 -0700)]
os: fix Windows build from earlier readdir change

It worked originally, until I renamed a variable. :/

dir_windows.go:11: undefined: e
http://godashboard.appspot.com/log/092397f2ac7a1e6e812dc6bebc65b40b02368700a119343d5cee5e2e89e0fde5

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

13 years agoimage/jpeg: decode grayscale images, not just color images.
Nigel Tao [Mon, 16 May 2011 17:13:17 +0000 (10:13 -0700)]
image/jpeg: decode grayscale images, not just color images.

Also add an image package test that DecodeConfig returns the same
ColorModel as what Decode would.

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

13 years agoos: make Readdir & Readdirnames return os.EOF at end
Brad Fitzpatrick [Mon, 16 May 2011 16:26:16 +0000 (09:26 -0700)]
os: make Readdir & Readdirnames return os.EOF at end

Fixes #678

R=rsc, r, alex.brainman, bsiegert, jdpoirier
CC=golang-dev
https://golang.org/cl/4536058

13 years agospec: fix copy to return "number of elements copied", not "number
Nigel Tao [Sun, 15 May 2011 23:04:37 +0000 (16:04 -0700)]
spec: fix copy to return "number of elements copied", not "number
of arguments copied".

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

13 years agostrings: make Reader.Read use copy instead of an explicit loop.
Nigel Tao [Sun, 15 May 2011 20:14:10 +0000 (13:14 -0700)]
strings: make Reader.Read use copy instead of an explicit loop.

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

13 years agogofmt: skip bug340.go in test.sh
Robert Hencke [Sun, 15 May 2011 06:06:50 +0000 (23:06 -0700)]
gofmt: skip bug340.go in test.sh

bug340.go is a test case for a syntax error

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

13 years agopkg: fix incorrect prints found by govet
Robert Hencke [Sun, 15 May 2011 03:43:18 +0000 (20:43 -0700)]
pkg: fix incorrect prints found by govet

Also, clarify some error messages

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

13 years agounicode: build maketables during testshort too
Brad Fitzpatrick [Sat, 14 May 2011 23:54:49 +0000 (16:54 -0700)]
unicode: build maketables during testshort too

Fixes #1825

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

13 years agocrypto/openpgp: change PublicKey.Serialize to include the header.
Adam Langley [Sat, 14 May 2011 23:13:12 +0000 (19:13 -0400)]
crypto/openpgp: change PublicKey.Serialize to include the header.

Signature.Serialize already does this and they should be consistent.

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

13 years agomisc/vim: drop indent support for jump labels.
David Symonds [Sat, 14 May 2011 16:45:32 +0000 (09:45 -0700)]
misc/vim: drop indent support for jump labels.

It interferes with keys in composite literals,
which are much more common.

R=dchest, jnwhiteh, rlight2
CC=golang-dev
https://golang.org/cl/4521065

13 years agofix windows build: http.Get finalURL removal missed earlier
Brad Fitzpatrick [Sat, 14 May 2011 01:56:39 +0000 (18:56 -0700)]
fix windows build: http.Get finalURL removal missed earlier

Not sure why this only broke Windows. Make test is only run
on windows for that directory?

TBR=golang-dev

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

13 years agogo/types: fix (some) builds
Robert Griesemer [Sat, 14 May 2011 01:33:04 +0000 (18:33 -0700)]
go/types: fix (some) builds

The position (type) for which the "invalid cycle" error
message is reported depends on which type in a cycle of
types is first checked. Which one is first depends on
the iteration order of maps which is different on
different platforms. For now, disable this error message.

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

13 years agocontrib*.html: make "golang-dev" the default reviewer.
Rob Pike [Fri, 13 May 2011 23:25:31 +0000 (16:25 -0700)]
contrib*.html: make "golang-dev" the default reviewer.
also make a couple of links more visible and fix an id= href.

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

13 years agohttp: add Request.SetBasicAuth method
Brad Fitzpatrick [Fri, 13 May 2011 22:43:46 +0000 (15:43 -0700)]
http: add Request.SetBasicAuth method

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

13 years agogc: generalize dst = append(src,...) inlining to arbitrary src and dst arguments.
Luuk van Dijk [Fri, 13 May 2011 22:35:10 +0000 (00:35 +0200)]
gc: generalize dst = append(src,...) inlining to arbitrary src and dst arguments.

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

13 years agogo/types: type checker API + testing infrastructure
Robert Griesemer [Fri, 13 May 2011 22:31:09 +0000 (15:31 -0700)]
go/types: type checker API + testing infrastructure

At the moment types.Check() only deals with global
types and only partially so. But the framework is
there to compute them and check for cycles. An initial
type test is passing.

First step of a series of CLs to come.

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

13 years agogo spec: fix error in production syntax
Robert Griesemer [Fri, 13 May 2011 19:54:51 +0000 (12:54 -0700)]
go spec: fix error in production syntax

Fix analoguous error in ebnf.go which already
correctly accepted an empty production.

Fixes #1821.

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

13 years agotiming: update numbers for regex-dna
Rob Pike [Fri, 13 May 2011 17:58:41 +0000 (10:58 -0700)]
timing: update numbers for regex-dna
After improved compilation of append, regexps improve and regex-dna is 35% faster.

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

13 years ago5c, 5g: fix build with too-smart gcc
Russ Cox [Fri, 13 May 2011 16:15:46 +0000 (12:15 -0400)]
5c, 5g: fix build with too-smart gcc

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

13 years agodashboard: delay hg pull until needed
Russ Cox [Fri, 13 May 2011 16:14:31 +0000 (12:14 -0400)]
dashboard: delay hg pull until needed

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

13 years agomisc/vim: new Vim indentation script.
David Symonds [Fri, 13 May 2011 15:29:44 +0000 (08:29 -0700)]
misc/vim: new Vim indentation script.

This uses a fully custom function for indenting Go code in Vim.
It provides a lot more flexibility than a cindent-based approach,
so this version gets the := operator correct, as well as switch
labels and jump labels.

One outstanding TODO is to handle lines immediately after jump labels.

R=adg, n13m3y3r, jnwhiteh, dchest, rsc, rlight2
CC=golang-dev, rivercheng
https://golang.org/cl/4534047

13 years agohttp: make HEAD client request follow redirects
Eivind Uggedal [Fri, 13 May 2011 15:17:59 +0000 (08:17 -0700)]
http: make HEAD client request follow redirects

HEAD requests should in my opinion have the ability to follow redirects
like the implementation of GET requests does. My use case is polling
several thousand severs to check if they respond with 200 status codes.
Using GET requests is neither efficient in running time of the task nor
for bandwidth consumption.

This suggested patch changes the return signature of http.Head() to match
that of http.Get(), providing the final URL in a redirect chain.

`curl -IL http://google.com` follows redirects with HEAD requests just fine.

Fixes #1806.

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

13 years agocodereview: handle 'null as missing field' in rietveld json
Russ Cox [Fri, 13 May 2011 15:17:06 +0000 (11:17 -0400)]
codereview: handle 'null as missing field' in rietveld json

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

13 years agoA+C: Eivind Uggedal (individual CLA)
Russ Cox [Fri, 13 May 2011 15:16:01 +0000 (08:16 -0700)]
A+C: Eivind Uggedal (individual CLA)

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

13 years agodoc: auto-generated html change missing from 7ee7980ea06d
Brad Fitzpatrick [Fri, 13 May 2011 15:12:34 +0000 (08:12 -0700)]
doc: auto-generated html change missing from 7ee7980ea06d

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

13 years agomisc/emacs: bug fix: use UTF-8 when invoking gofmt as a subprocess.
Sameer Ajmani [Fri, 13 May 2011 15:05:03 +0000 (11:05 -0400)]
misc/emacs: bug fix: use UTF-8 when invoking gofmt as a subprocess.
Without this, Unicode characters are stripped out by M-x gofmt.

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

13 years agohttp: remove finalURL from Client.Get; move to Response
Brad Fitzpatrick [Fri, 13 May 2011 14:31:24 +0000 (07:31 -0700)]
http: remove finalURL from Client.Get; move to Response

This CL:

-- removes Response.RequestMethod string
-- adds Response.Request *Request
-- removes the finalURL result parameter from client.Get()
-- adds a gofix rule for callers of http.Get which assign
   the final url to the blank identifier; warning otherwise

Caller who did:

res, finalURL, err := http.Get(...)

now need to do:

res, err := http.Get(...)
if err != nil {
   ...
}
finalURL := res.Request.URL.String()

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

13 years agonet: remove unused functions
Mikio Hara [Fri, 13 May 2011 14:00:06 +0000 (07:00 -0700)]
net: remove unused functions

Remove unused functions, getip() and sockaddrToString().
Remove unnecessary linebreaks.

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

13 years ago6l, 8l: emit windows dwarf sections similar to other platforms
Alex Brainman [Fri, 13 May 2011 06:05:47 +0000 (16:05 +1000)]
6l, 8l: emit windows dwarf sections similar to other platforms

R=golang-dev, rsc
CC=golang-dev, vcc.163
https://golang.org/cl/4517056

13 years agostrconv: document and test True and False for Atob
Robert Hencke [Fri, 13 May 2011 05:00:50 +0000 (22:00 -0700)]
strconv: document and test True and False for Atob

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

13 years agogotest: document unit of time for elapsed()
Robert Hencke [Fri, 13 May 2011 05:00:14 +0000 (22:00 -0700)]
gotest: document unit of time for elapsed()

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

13 years agogo/*: various small fixes
Robert Griesemer [Fri, 13 May 2011 03:14:58 +0000 (20:14 -0700)]
go/*: various small fixes

parser:
- resolve embedded interface type names
ast:
- clarify some comments
- correctly unquote import paths

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

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