Commit Graph

8401 Commits

Author SHA1 Message Date
Nigel Tao
703b092779 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
2011-05-15 16:04:37 -07:00
Nigel Tao
77d66f4131 strings: make Reader.Read use copy instead of an explicit loop.
R=r, bradfitz, r
CC=golang-dev
https://golang.org/cl/4529064
2011-05-15 13:14:10 -07:00
Robert Hencke
d49844bcce 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
2011-05-14 23:06:50 -07:00
Robert Hencke
cc2fc02467 pkg: fix incorrect prints found by govet
Also, clarify some error messages

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4548042
2011-05-14 20:43:18 -07:00
Brad Fitzpatrick
870791a5ac unicode: build maketables during testshort too
Fixes #1825

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4535066
2011-05-14 16:54:49 -07:00
Adam Langley
4eb67563f6 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
2011-05-14 19:13:12 -04:00
David Symonds
816f4bb1d8 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
2011-05-14 09:45:32 -07:00
Brad Fitzpatrick
b2400c28cf 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
2011-05-13 18:56:39 -07:00
Robert Griesemer
c35c672020 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
2011-05-13 18:33:04 -07:00
Rob Pike
9ada841f4d 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
2011-05-13 16:25:31 -07:00
Brad Fitzpatrick
cd4d0004fa http: add Request.SetBasicAuth method
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4543050
2011-05-13 15:43:46 -07:00
Luuk van Dijk
36cec789cd gc: generalize dst = append(src,...) inlining to arbitrary src and dst arguments.
R=rsc
CC=golang-dev
https://golang.org/cl/4517057
2011-05-14 00:35:10 +02:00
Robert Griesemer
ba006e6b6a 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
2011-05-13 15:31:09 -07:00
Robert Griesemer
32b822f29a 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
2011-05-13 12:54:51 -07:00
Rob Pike
5236814edd 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
2011-05-13 10:58:41 -07:00
Russ Cox
2d174db6a6 5c, 5g: fix build with too-smart gcc
R=ken2
CC=golang-dev
https://golang.org/cl/4543049
2011-05-13 12:15:46 -04:00
Russ Cox
ac65eaa5b9 dashboard: delay hg pull until needed
R=adg
CC=golang-dev
https://golang.org/cl/4526052
2011-05-13 12:14:31 -04:00
David Symonds
1a7d09c847 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
2011-05-13 08:29:44 -07:00
Eivind Uggedal
092f34feca 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
2011-05-13 08:17:59 -07:00
Russ Cox
404d49154b codereview: handle 'null as missing field' in rietveld json
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4543046
2011-05-13 11:17:06 -04:00
Russ Cox
3b4a8ff604 A+C: Eivind Uggedal (individual CLA)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4519055
2011-05-13 08:16:01 -07:00
Brad Fitzpatrick
e113e405de doc: auto-generated html change missing from 7ee7980ea06d
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4515077
2011-05-13 08:12:34 -07:00
Sameer Ajmani
cc5ac676da 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
2011-05-13 11:05:03 -04:00
Brad Fitzpatrick
05a1b7ec41 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
2011-05-13 07:31:24 -07:00
Mikio Hara
4336116d3b net: remove unused functions
Remove unused functions, getip() and sockaddrToString().
Remove unnecessary linebreaks.

R=golang-dev
CC=golang-dev
https://golang.org/cl/4523062
2011-05-13 07:00:06 -07:00
Alex Brainman
34ac4ec30c 6l, 8l: emit windows dwarf sections similar to other platforms
R=golang-dev, rsc
CC=golang-dev, vcc.163
https://golang.org/cl/4517056
2011-05-13 16:05:47 +10:00
Robert Hencke
142008c325 strconv: document and test True and False for Atob
R=golang-dev
CC=golang-dev
https://golang.org/cl/4535057
2011-05-12 22:00:50 -07:00
Robert Hencke
a005617c5a gotest: document unit of time for elapsed()
R=golang-dev
CC=golang-dev
https://golang.org/cl/4543044
2011-05-12 22:00:14 -07:00
Robert Griesemer
71630337f2 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
2011-05-12 20:14:58 -07:00
Russ Cox
71102ad25b codereview: fix clpatch
TBR=gri
CC=golang-dev
https://golang.org/cl/4534052
2011-05-12 23:11:52 -04:00
Benny Siegert
14c59abd76 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
2011-05-12 22:34:48 -04:00
Brad Fitzpatrick
f4e5f364c7 html: parse empty, unquoted, and single-quoted attribute values
Fixes #1391

R=nigeltao
CC=golang-dev
https://golang.org/cl/4453054
2011-05-12 16:11:35 -07:00
Robert Griesemer
5473103666 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
2011-05-12 09:15:59 -07:00
Robert Griesemer
82d1a9dce7 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
2011-05-12 09:01:50 -07:00
Robert Griesemer
d376935a18 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
2011-05-12 09:01:32 -07:00
Robert Griesemer
26bbb2b2f7 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
2011-05-12 09:01:10 -07:00
Russ Cox
12c3afc1ae 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
2011-05-12 11:21:34 -04:00
Johan Euphrosine
5f6e1cfca7 doc/codelab: correct typo.
s/Sprintf/Fprintf/

R=golang-dev, rsc
CC=adg, golang-dev
https://golang.org/cl/4519053
2011-05-12 11:21:10 -04:00
Russ Cox
607f5bac94 CONTRIBUTORS: add Johan Euphrosine (Google CLA)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4515070
2011-05-12 11:21:00 -04:00
Russ Cox
70798eaad6 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
2011-05-11 23:59:36 -04:00
Anthony Martin
4fca395321 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
2011-05-11 23:52:05 -04:00
Lorenzo Stoakes
f58d911698 gc: fix type switch error message for invalid cases.
Fixes #1606.

R=rsc
CC=golang-dev
https://golang.org/cl/4532045
2011-05-11 23:41:59 -04:00
Russ Cox
9d2a697fb9 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
2011-05-11 23:26:52 -04:00
Anthony Martin
fbb4be3278 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
2011-05-11 22:53:42 -04:00
Brad Fitzpatrick
fa23a70044 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
2011-05-11 22:33:15 -04:00
Adam Langley
d080a1cf14 compress/zlib: actually use provided dictionary.
R=rsc, bradfitz, bradfitzgoog
CC=golang-dev
https://golang.org/cl/4518056
2011-05-11 17:00:19 -04:00
Christian Himpel
158970ea66 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
2011-05-11 13:33:27 -07:00
Brad Fitzpatrick
ca83cd2c2f 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
2011-05-11 12:11:32 -07:00
Nigel Tao
51e6aa1e88 image/bmp: implement a BMP decoder.
R=r
CC=golang-dev
https://golang.org/cl/4521054
2011-05-11 11:12:45 -07:00
Nigel Tao
67992cae53 image/gif: minor fixes.
R=r
CC=golang-dev
https://golang.org/cl/4523054
2011-05-11 11:11:25 -07:00