]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agoweekly.2011-03-15 weekly.2011-03-15
Andrew Gerrand [Wed, 16 Mar 2011 05:24:08 +0000 (16:24 +1100)]
weekly.2011-03-15

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

14 years agogob: keep free lists of encoder and decoder states.
Rob Pike [Wed, 16 Mar 2011 04:30:07 +0000 (21:30 -0700)]
gob: keep free lists of encoder and decoder states.
Avoids 3 mallocs in a round trip encoding/decoding a struct.

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

14 years agogofix: fix godoc doc
Alex Brainman [Wed, 16 Mar 2011 04:20:46 +0000 (15:20 +1100)]
gofix: fix godoc doc

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

14 years agogofix: fix procattr registration, tests
Russ Cox [Wed, 16 Mar 2011 02:58:09 +0000 (13:58 +1100)]
gofix: fix procattr registration, tests

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

14 years agogofix: procattr
Russ Cox [Wed, 16 Mar 2011 02:33:57 +0000 (22:33 -0400)]
gofix: procattr

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

14 years agogo/printer: output tuning for gofix
Robert Griesemer [Wed, 16 Mar 2011 00:45:16 +0000 (17:45 -0700)]
go/printer: output tuning for gofix

If braces don't have position information for a composite
literal, don't assume alignment of key:value pairs under
the (wrong) assumption that there may be multiple lines.

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

14 years agogob: move benchmarks to a new timing_test.go file.
Rob Pike [Wed, 16 Mar 2011 00:14:02 +0000 (17:14 -0700)]
gob: move benchmarks to a new timing_test.go file.
Add malloc counts for encode and decode.

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

14 years agodebug/proc: fix build
Russ Cox [Tue, 15 Mar 2011 23:39:50 +0000 (19:39 -0400)]
debug/proc: fix build

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

14 years agorpc: add the ability to write out a memory profile during testing.
Rob Pike [Tue, 15 Mar 2011 21:20:30 +0000 (14:20 -0700)]
rpc: add the ability to write out a memory profile during testing.

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

14 years agorpc: add benchmarks
Rob Pike [Tue, 15 Mar 2011 20:09:11 +0000 (13:09 -0700)]
rpc: add benchmarks

On my mac:
mallocs per rpc round trip: 144
rpc.BenchmarkEndToEnd    10000     228244 ns/op

Room for improvement.

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

14 years agolib9, libmach: Change GOOS references to GOHOSTOS
Evan Shaw [Tue, 15 Mar 2011 18:42:18 +0000 (14:42 -0400)]
lib9, libmach: Change GOOS references to GOHOSTOS

This makes it possible to build Windows binaries on non-Windows OSes.

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

14 years agoos, syscall: add ProcAttr type. Change StartProcess etc. to use it.
Roger Peppe [Tue, 15 Mar 2011 18:41:19 +0000 (14:41 -0400)]
os, syscall: add ProcAttr type. Change StartProcess etc. to use it.
The Windows code is untested.

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

14 years agogofix: new command for updating code to new release
Russ Cox [Tue, 15 Mar 2011 18:15:41 +0000 (14:15 -0400)]
gofix: new command for updating code to new release

R=bradfitzgo, dsymonds, r, gri, adg
CC=golang-dev
https://golang.org/cl/4282044

14 years agogc: diagnose unused labels
Russ Cox [Tue, 15 Mar 2011 18:05:37 +0000 (14:05 -0400)]
gc: diagnose unused labels

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

14 years agoremove unused labels
Russ Cox [Tue, 15 Mar 2011 18:05:07 +0000 (14:05 -0400)]
remove unused labels

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

14 years agogofmt: simpler walkDir
Russ Cox [Tue, 15 Mar 2011 18:04:47 +0000 (14:04 -0400)]
gofmt: simpler walkDir

Swapping the goroutines lets them reuse the
communication completion on v instead of
needing a second channel (done).

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

14 years agospec: disallow unused labels
Russ Cox [Tue, 15 Mar 2011 17:51:24 +0000 (13:51 -0400)]
spec: disallow unused labels

Also change labelled examples to use gofmt formatting.

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

14 years agohttptest: default the Recorder status code to 200 on a Write
Brad Fitzpatrick [Tue, 15 Mar 2011 17:13:25 +0000 (10:13 -0700)]
httptest: default the Recorder status code to 200 on a Write

This matches the real ResponseWriter behavior.

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

14 years agoopenpgp: add PublicKey KeyId string accessors
Brad Fitzpatrick [Tue, 15 Mar 2011 17:06:17 +0000 (10:06 -0700)]
openpgp: add PublicKey KeyId string accessors

R=agl, agl1
CC=golang-dev
https://golang.org/cl/4297041

14 years agorpc: add buffering to the encode path.
Rob Pike [Tue, 15 Mar 2011 17:02:44 +0000 (10:02 -0700)]
rpc: add buffering to the encode path.
This reduces the number of writes by 2 (1 client, 1 server) on each round trip.
A simple test shows 24% higher throughput.

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

14 years agolibmach: correct string comparison to revive 6cov on darwin
Dave Cheney [Mon, 14 Mar 2011 21:12:37 +0000 (14:12 -0700)]
libmach: correct string comparison to revive 6cov on darwin

R=golang-dev, r, dsymonds, rsc1
CC=golang-dev
https://golang.org/cl/4277046

14 years ago5l: fix build
Russ Cox [Mon, 14 Mar 2011 19:43:58 +0000 (15:43 -0400)]
5l: fix build

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

14 years agogc: include all dependencies in export metadata
Russ Cox [Mon, 14 Mar 2011 17:22:34 +0000 (13:22 -0400)]
gc: include all dependencies in export metadata

This change records more metadata about what
influenced the creation of the object file.
Specifically, if a package imports, say, "fmt" but does not
need to describe any fmt types in its own export data,
that package's object file did not mention the dependency
on "fmt" before.  Now it does.

Listing the import is purely informational.
It has no effect on which files are opened or consulted
when importing a package.

Import lines are marked indirect when they are needed
to explain the API but were not imported directly.
For example http imports crypto/tls and exports
a struct with a field of type tls.ConnectionState,
which contains an x509.Certificate.  Since http does
not import x509 but needs to explain the x509.Certificate
type in its export data, the import of x509 is marked
as indirect.  These import lines were always present;
marking them with the indirect comment makes clear
which were imported directly and which are incidental.

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

14 years agobuild: remove duplicate dependency in Make.cmd
Robert Hencke [Mon, 14 Mar 2011 16:33:44 +0000 (12:33 -0400)]
build: remove duplicate dependency in Make.cmd

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

14 years agocrypto/tls: fix compile error
Dave Cheney [Sun, 13 Mar 2011 03:35:41 +0000 (19:35 -0800)]
crypto/tls: fix compile error

Fixes #1555.

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

14 years agoioutil: add NopCloser
Brad Fitzpatrick [Sun, 13 Mar 2011 00:05:07 +0000 (16:05 -0800)]
ioutil: add NopCloser

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

14 years agohttp: use Header.Del not empty Set(k, "")
Brad Fitzpatrick [Sat, 12 Mar 2011 17:58:53 +0000 (09:58 -0800)]
http: use Header.Del not empty Set(k, "")

Also don't serialize empty headers.

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

14 years agoruntime/proc.c: which to that
Rob Pike [Sat, 12 Mar 2011 02:18:59 +0000 (18:18 -0800)]
runtime/proc.c: which to that

R=iant, dho
CC=golang-dev
https://golang.org/cl/4286044

14 years agoruntime: reduce lock contention via wakeup on scheduler unlock.
Ian Lance Taylor [Sat, 12 Mar 2011 02:14:45 +0000 (18:14 -0800)]
runtime: reduce lock contention via wakeup on scheduler unlock.

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

14 years agonet: don't loop to drain wakeup pipe.
Ian Lance Taylor [Sat, 12 Mar 2011 02:01:28 +0000 (18:01 -0800)]
net: don't loop to drain wakeup pipe.

The loop always makes an extra system call.  It only makes a
difference if more than 100 goroutines started waiting for
something to happen on a network file descriptor since the
last time the pipe was drained, which is unlikely since we
will be woken up the first time a goroutine starts waiting.
If we don't drain the pipe this time, we'll be woken up again
right away and can drain again.

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

14 years agogob: use bufio on the decode to avoid a system call on each read.
Rob Pike [Sat, 12 Mar 2011 00:24:09 +0000 (16:24 -0800)]
gob: use bufio on the decode to avoid a system call on each read.
Add a benchmark.
BenchmarkEndToEndPipe gives 14.3microseconds/op before,
13.1microseconds/op after, or about 76e3 round trips per second
through the kernel.
With a bytes buffer, and therefore no system calls for I/O, the
numbers go to 7.3microseconds/op, or about 137e3 round trips
per second.

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

14 years agogotype: clean handling of stdin, added tests
Robert Griesemer [Sat, 12 Mar 2011 00:15:33 +0000 (16:15 -0800)]
gotype: clean handling of stdin, added tests

- removed uses of global variables
- minor cleanups

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

14 years agogo/typechecker: fix build
Robert Griesemer [Fri, 11 Mar 2011 22:46:36 +0000 (14:46 -0800)]
go/typechecker: fix build

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

14 years agogo/parser: first constant in a constant declaration must have a value
Robert Griesemer [Fri, 11 Mar 2011 22:33:31 +0000 (14:33 -0800)]
go/parser: first constant in a constant declaration must have a value

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

14 years agobuild: run gotest in misc/cgo/test
Russ Cox [Fri, 11 Mar 2011 20:09:32 +0000 (15:09 -0500)]
build: run gotest in misc/cgo/test

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

14 years agoruntime: split non-debugging malloc interface out of debug.go into mem.go
Russ Cox [Fri, 11 Mar 2011 20:09:21 +0000 (15:09 -0500)]
runtime: split non-debugging malloc interface out of debug.go into mem.go

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

14 years agogo code: replace closed(c) with x, ok := <-c
Russ Cox [Fri, 11 Mar 2011 19:47:44 +0000 (14:47 -0500)]
go code: replace closed(c) with x, ok := <-c

R=golang-dev, rog, bradfitzwork, r
CC=golang-dev
https://golang.org/cl/4243072

14 years agogc, runtime: replace closed(c) with x, ok := <-c
Russ Cox [Fri, 11 Mar 2011 19:47:26 +0000 (14:47 -0500)]
gc, runtime: replace closed(c) with x, ok := <-c

R=ken2, ken3
CC=golang-dev
https://golang.org/cl/4259064

14 years agospec: remove closed from language, replaced by x, ok = <-c
Russ Cox [Fri, 11 Mar 2011 19:47:02 +0000 (14:47 -0500)]
spec: remove closed from language, replaced by x, ok = <-c

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

14 years agohttp: rename interface Transport to RoundTripper
Brad Fitzpatrick [Fri, 11 Mar 2011 19:32:33 +0000 (11:32 -0800)]
http: rename interface Transport to RoundTripper

Transport.Do -> RoundTripper.RoundTrip

This makes way for a subsequent CL to export the
currently private RoundTripper implementation
as struct Transport.

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

14 years agogotype: commandline tool to typecheck go programs
Robert Griesemer [Fri, 11 Mar 2011 18:27:25 +0000 (10:27 -0800)]
gotype: commandline tool to typecheck go programs

First version. Handles scope analysis only at the
moment.

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

14 years agohttp: fix transport crash when request URL is nil
Brad Fitzpatrick [Fri, 11 Mar 2011 17:54:31 +0000 (09:54 -0800)]
http: fix transport crash when request URL is nil

Fixes #1602

R=rsc, petar-m
CC=golang-dev
https://golang.org/cl/4284043

14 years agogopack: omit time stamps
Russ Cox [Fri, 11 Mar 2011 15:08:49 +0000 (10:08 -0500)]
gopack: omit time stamps

This makes it possible to build a package twice
and get the same bytes both times.

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

14 years ago.hgtags: s/release/weekly/
Andrew Gerrand [Fri, 11 Mar 2011 07:04:18 +0000 (18:04 +1100)]
.hgtags: s/release/weekly/
.hgtags, release.html: tag current weekly as release.r56

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

14 years agoio/ioutil: clean-up of ReadAll and ReadFile
Robert Griesemer [Fri, 11 Mar 2011 00:41:54 +0000 (16:41 -0800)]
io/ioutil: clean-up of ReadAll and ReadFile

Make ReadAll use the same mechanism as ReadFile.

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

14 years agogo/ast: fix printing of maps
Robert Griesemer [Fri, 11 Mar 2011 00:00:39 +0000 (16:00 -0800)]
go/ast: fix printing of maps

Print a newline after each map entry;
similar to the style used for slices
and structs.

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

14 years agogo/ast: ast.Print needs a file set to print position values nicely
Robert Griesemer [Thu, 10 Mar 2011 20:54:33 +0000 (12:54 -0800)]
go/ast: ast.Print needs a file set to print position values nicely

Also removed a TODO (AST nodes have been restructured a while ago).

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

14 years agogofmt: remove -trace and -ast flags
Robert Griesemer [Thu, 10 Mar 2011 20:54:18 +0000 (12:54 -0800)]
gofmt: remove -trace and -ast flags

Functionality was only present for
debuggging and now is available in
gocheck where is makes more sense.

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

14 years agoflag: visit the flags in sorted order, for better messages.
Rob Pike [Thu, 10 Mar 2011 20:42:31 +0000 (12:42 -0800)]
flag: visit the flags in sorted order, for better messages.
Fixes #1601.

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

14 years agohttp: run tests even with DISABLE_NET_TESTS=1
Brad Fitzpatrick [Thu, 10 Mar 2011 18:19:11 +0000 (10:19 -0800)]
http: run tests even with DISABLE_NET_TESTS=1

All tests are now localhost only.

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

14 years agohttp: don't hit external network in client_test.go
Brad Fitzpatrick [Thu, 10 Mar 2011 16:46:57 +0000 (08:46 -0800)]
http: don't hit external network in client_test.go

More reliable.

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

14 years agohttp: move RemoteAddr & UsingTLS from ResponseWriter to Request
Brad Fitzpatrick [Thu, 10 Mar 2011 16:17:22 +0000 (08:17 -0800)]
http: move RemoteAddr & UsingTLS from ResponseWriter to Request

ResponseWriter.RemoteAddr() string -> Request.RemoteAddr string
ResponseWriter.UsingTLS() bool -> Request.TLS *tls.ConnectionState

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

14 years agocrypto/openpgp: s/serialise/serialize/
Adam Langley [Thu, 10 Mar 2011 15:36:04 +0000 (10:36 -0500)]
crypto/openpgp: s/serialise/serialize/

(No code changes, Americanization only.)

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

14 years agotls: move PeerCertificates to ConnectionState
Brad Fitzpatrick [Thu, 10 Mar 2011 15:22:53 +0000 (07:22 -0800)]
tls: move PeerCertificates to ConnectionState

R=agl, agl1
CC=golang-dev, rsc
https://golang.org/cl/4248078

14 years agocrypto/openpgp: bug fixes and fix misnamed function.
Adam Langley [Thu, 10 Mar 2011 15:14:31 +0000 (10:14 -0500)]
crypto/openpgp: bug fixes and fix misnamed function.

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

14 years agocrypto/elliptic: add the N value of each curve.
Adam Langley [Thu, 10 Mar 2011 15:04:06 +0000 (10:04 -0500)]
crypto/elliptic: add the N value of each curve.

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

14 years agocrypto/ecdsa: add package.
Adam Langley [Thu, 10 Mar 2011 14:42:34 +0000 (09:42 -0500)]
crypto/ecdsa: add package.

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

14 years agogob: turn two panics into errors because they can be triggered
Rob Pike [Thu, 10 Mar 2011 01:30:27 +0000 (17:30 -0800)]
gob: turn two panics into errors because they can be triggered
by bogus data, or are in any case recoverable.

Fixes #1598.

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

14 years agofmt: heaven forfend we export EOF = -1
Rob Pike [Thu, 10 Mar 2011 00:53:32 +0000 (16:53 -0800)]
fmt: heaven forfend we export EOF = -1

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

14 years agoEffective Go: some small cleanups.
Rob Pike [Thu, 10 Mar 2011 00:47:40 +0000 (16:47 -0800)]
Effective Go: some small cleanups.
Add discussion of getters.
Add example using a map as a set.

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

14 years agosyslog: split Unix domain support from network support.
Ian Lance Taylor [Wed, 9 Mar 2011 21:15:46 +0000 (13:15 -0800)]
syslog: split Unix domain support from network support.

This is to make it easier to support Solaris syslog.  On
Solaris syslog messages are sent via STREAMS using putmsg to
/dev/conslog.  The putmsg call uses a a control buffer of type
log_cdtl and a data buffer which is the message, and it is in
general a big mess.  This CL just splits out the Unix domain
support so that Solaris can use a different mechanism.  I do
not propose to implement the Solaris support today.  This
split will make it possible for gccgo to just call the libc
function for now.

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

14 years agohttp: add Flusher type; remove Flush from ResponseWriter
Brad Fitzpatrick [Wed, 9 Mar 2011 18:24:50 +0000 (10:24 -0800)]
http: add Flusher type; remove Flush from ResponseWriter

The Flush functionality wasn't removed, but now you have
to test if your ResponseWriter is also a Flusher:

func ServeHTTP(rw http.ResponseWriter, req *http.Request) {
   if f, ok := rw.(http.Flusher); ok {
       f.Flush()
   }
}

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

14 years agorpc: delete unused field from InvalidRequest struct.
Rob Pike [Wed, 9 Mar 2011 18:02:17 +0000 (10:02 -0800)]
rpc: delete unused field from InvalidRequest struct.
Was a mysterious holdover from an attempt to fix a problem
long-resolved, I think.

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

14 years agofmt: make ScanState.Token more general.
Roger Peppe [Wed, 9 Mar 2011 18:01:47 +0000 (10:01 -0800)]
fmt: make ScanState.Token more general.
When writing custom scanners, I found that
Token itself was rarely useful, as I did not always
want to stop at white space. This change makes
it possible to stop at any class of characters
while reusing the buffer within State.
(also fix a bug in Token)

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

14 years agohttp: change ResponseWriter.SetHeader(k,v) to Header() accessor
Brad Fitzpatrick [Wed, 9 Mar 2011 17:41:01 +0000 (09:41 -0800)]
http: change ResponseWriter.SetHeader(k,v) to Header() accessor

Caller code needs to change:

rw.SetHeader("Content-Type", "text/plain")
to:
rw.Header().Set("Content-Type", "text/plain")

This now permits returning multiple headers
with the same name using Add:

rw.Header().Add("Set-Cookie", "..")
rw.Header().Add("Set-Cookie", "..")

This patch also fixes serialization of headers, removing newline characters.

Fixes #488
Fixes #914

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

14 years agogc: fix comments in go.h
Lorenzo Stoakes [Wed, 9 Mar 2011 16:35:18 +0000 (08:35 -0800)]
gc: fix comments in go.h

Trivial fix to '// n' comments against etype enum in go.h, as these have
got out of sync.

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

14 years agold: preserve symbol sizes during data layout
Russ Cox [Wed, 9 Mar 2011 16:18:29 +0000 (11:18 -0500)]
ld: preserve symbol sizes during data layout

Fixes the broken linux/amd64 build.
The symbol table, itself a symbol, was having
its size rounded up to the nearest word boundary.
If the rounding add >7 zero bytes then it confused
the debug/gosym symbol table parser.  So you've
got a 1/8 chance to hit the bug on an amd64 system.

Just started in the recent change because I fixed
the rounding to round to word boundary instead
of to 4-byte boundary.

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

14 years agosyscall: implement Mount and Unmount for linux.
David Anderson [Wed, 9 Mar 2011 13:58:47 +0000 (05:58 -0800)]
syscall: implement Mount and Unmount for linux.

Note that, while the final argument of mount(2) is a void*, in
practice all filesystem implementations treat it as a string
of comma-separated mount options.

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

14 years agosyscall: implement Reboot for linux.
David Anderson [Wed, 9 Mar 2011 13:45:08 +0000 (05:45 -0800)]
syscall: implement Reboot for linux.

The published interface is the simple version of the syscall,
allowing all reboot functions except for the esoteric
LINUX_REBOOT_CMD_RESTART2.

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

14 years agocompress/lzw: benchmark a range of input sizes.
Nigel Tao [Wed, 9 Mar 2011 05:32:02 +0000 (16:32 +1100)]
compress/lzw: benchmark a range of input sizes.

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

14 years agodoc: update codelab wiki to fix template.Execute argument order
Andrew Gerrand [Wed, 9 Mar 2011 01:59:13 +0000 (12:59 +1100)]
doc: update codelab wiki to fix template.Execute argument order

Fixes #1595.

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

14 years agobig: implemented custom Gob(En/De)coder for Int type
Robert Griesemer [Wed, 9 Mar 2011 01:27:44 +0000 (17:27 -0800)]
big: implemented custom Gob(En/De)coder for Int type

- factored implementation of Int.Bytes, Int.SetBytes
  and replaced existing code with much simpler cores
- use the shared bytes, setBytes routines for Gob
  (en/de)coding

Fixes #1496.

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

14 years agogovet: handle '*' in print format strings.
Rob Pike [Tue, 8 Mar 2011 22:36:56 +0000 (14:36 -0800)]
govet: handle '*' in print format strings.
While we're on govet, fix a couple of mistakes in a test.

Fixes #1592.

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

14 years ago5l, 8l: output missing section symbols
Anthony Martin [Tue, 8 Mar 2011 22:15:20 +0000 (17:15 -0500)]
5l, 8l: output missing section symbols

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

14 years agoFAQ: hello, world is now 1.1MB, down from 1.8MB
Rob Pike [Tue, 8 Mar 2011 19:47:41 +0000 (11:47 -0800)]
FAQ: hello, world is now 1.1MB, down from 1.8MB

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

14 years ago5l, 6l, 8l: omit symbols for type, string, go.string
Russ Cox [Tue, 8 Mar 2011 19:14:28 +0000 (14:14 -0500)]
5l, 6l, 8l: omit symbols for type, string, go.string

Much of the bulk of Go binaries is the symbol tables,
which give a name to every C string, Go string,
and reflection type symbol.  These names are not worth
much other than seeing what's where in a binary.

This CL deletes all those names from the symbol table,
instead aggregating the symbols into contiguous blocks
and giving them the names "string.*", "go.string.*", and "type.*".

Before:
$ 6nm $(which godoc.old) | sort | grep ' string\.' | tail -10
  59eda4 D string."aa87ca22be8b05378eb1c71...
  59ee08 D string."b3312fa7e23ee7e4988e056...
  59ee6c D string."func(*token.FileSet, st...
  59eed0 D string."func(io.Writer, []uint8...
  59ef34 D string."func(*tls.Config, *tls....
  59ef98 D string."func(*bool, **template....
  59effc D string."method(p *printer.print...
  59f060 D string."method(S *scanner.Scann...
  59f12c D string."func(*struct { begin in...
  59f194 D string."method(ka *tls.ecdheRSA...
$

After:
$ 6nm $(which godoc) | sort | grep ' string\.' | tail -10
  5e6a30 D string.*
$

Those names in the "Before" are truncated for the CL.
In the real binary they are the complete string, up to
a certain length, or else a unique identifier.
The same applies to the type and go.string symbols.

Removing the names cuts godoc by more than half:

-rwxr-xr-x 1 rsc rsc 9153405 2011-03-07 23:19 godoc.old
-rwxr-xr-x 1 rsc rsc 4290071 2011-03-07 23:19 godoc

For what it's worth, only 80% of what's left gets loaded
into memory; the other 20% is dwarf debugging information
only ever accessed by gdb:

-rwxr-xr-x 1 rsc rsc 3397787 2011-03-07 23:19 godoc.nodwarf

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

14 years agonm: document -S flag
Russ Cox [Tue, 8 Mar 2011 18:04:30 +0000 (13:04 -0500)]
nm: document -S flag

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

14 years agoMake.cmd: also clean _test*
Gustavo Niemeyer [Tue, 8 Mar 2011 18:02:02 +0000 (15:02 -0300)]
Make.cmd: also clean _test*

Fixes #1593.

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

14 years agostrings: better benchmark names; add BenchmarkIndex
Brad Fitzpatrick [Tue, 8 Mar 2011 17:58:18 +0000 (09:58 -0800)]
strings: better benchmark names; add BenchmarkIndex

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

14 years agostrings: add IndexRune tests, ASCII fast path
Brad Fitzpatrick [Tue, 8 Mar 2011 17:41:12 +0000 (09:41 -0800)]
strings: add IndexRune tests, ASCII fast path

$ gotest -test.v -test.run=IndexRune -test.bench=.*
=== RUN  strings_test.TestIndexRune
--- PASS: strings_test.TestIndexRune (0.0 seconds)
PASS
strings_test.BenchmarkIndexRune 20000000   105 ns/op
strings_test.BenchmarkIndexByte 50000000    48 ns/op

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

14 years agotime: fix Time.ZoneOffset documentation
Peter Mundy [Tue, 8 Mar 2011 17:33:49 +0000 (12:33 -0500)]
time: fix Time.ZoneOffset documentation

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

14 years ago6l,8l: fix gdb crash.
Luuk van Dijk [Tue, 8 Mar 2011 17:28:42 +0000 (18:28 +0100)]
6l,8l: fix gdb crash.
DWARF function types no longer need to be pointer-ified explicitly.
Fixes #1579.

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

14 years agocodereview.py: do not suggest hg change -d if current user is not CL author
Robert Hencke [Tue, 8 Mar 2011 17:23:06 +0000 (12:23 -0500)]
codereview.py: do not suggest hg change -d if current user is not CL author

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

14 years agocgi: child support (e.g. Go CGI under Apache)
Brad Fitzpatrick [Tue, 8 Mar 2011 16:01:19 +0000 (08:01 -0800)]
cgi: child support (e.g. Go CGI under Apache)

The http/cgi package now supports both being
a CGI host or being a CGI child process.

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

14 years agogob: finish up GobEncoder/Decoder by providing indirection
Rob Pike [Tue, 8 Mar 2011 08:02:07 +0000 (00:02 -0800)]
gob: finish up GobEncoder/Decoder by providing indirection
to the receiver. Remove lots of TODOS.

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

14 years agoflag: failf documentation nit
Robert Hencke [Tue, 8 Mar 2011 07:02:07 +0000 (18:02 +1100)]
flag: failf documentation nit

"standard output" should have been "standard error".  Sorry about that..

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

14 years agohttp: add test for recently fixed HTTP/1.0 keep-alive issue
Andrew Gerrand [Tue, 8 Mar 2011 05:12:44 +0000 (16:12 +1100)]
http: add test for recently fixed HTTP/1.0 keep-alive issue

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

14 years agomisc/vim: Add indent script for Vim
Ross Light [Tue, 8 Mar 2011 04:42:23 +0000 (15:42 +1100)]
misc/vim: Add indent script for Vim

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

14 years agoflag: replace fail with failf
Robert Hencke [Tue, 8 Mar 2011 04:41:36 +0000 (15:41 +1100)]
flag: replace fail with failf

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

14 years agogc: fix handling of return values named _
Russ Cox [Tue, 8 Mar 2011 00:36:17 +0000 (19:36 -0500)]
gc: fix handling of return values named _

Fixes #1586.

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

14 years agogo spec: clarify return statement rules
Robert Griesemer [Tue, 8 Mar 2011 00:29:07 +0000 (16:29 -0800)]
go spec: clarify return statement rules

Added example of a return statement w/o expressions
in a function with a _ result parameter.

See also: http://code.google.com/p/go/issues/detail?id=1586

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

14 years agonet: fix test for Solaris: gopher and http are not in /etc/services.
Ian Lance Taylor [Mon, 7 Mar 2011 23:31:41 +0000 (15:31 -0800)]
net: fix test for Solaris: gopher and http are not in /etc/services.

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

14 years agoos: adjust test: /bin is a symlink, not a directory, on Solaris.
Ian Lance Taylor [Mon, 7 Mar 2011 23:30:51 +0000 (15:30 -0800)]
os: adjust test: /bin is a symlink, not a directory, on Solaris.

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

14 years agoruntime: remove unused declarations from mgc0.c.
Ian Lance Taylor [Mon, 7 Mar 2011 23:30:25 +0000 (15:30 -0800)]
runtime: remove unused declarations from mgc0.c.

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

14 years agogc: unsafe.Pointer is not a pointer
Russ Cox [Mon, 7 Mar 2011 20:10:01 +0000 (15:10 -0500)]
gc: unsafe.Pointer is not a pointer

Change unsafe.Pointer to be its own kind of
type, instead of making it equivalent to *any.
The change complicates import and export
but avoids the need to find all the places that
operate on pointers but should not operate on
unsafe.Pointer.

Fixes #1566. (a different way)
Fixes #1582.

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

14 years agogob: support GobEncoder for type T when the receiver is *T.
Rob Pike [Mon, 7 Mar 2011 20:08:31 +0000 (12:08 -0800)]
gob: support GobEncoder for type T when the receiver is *T.
Still to do: **T.

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

14 years agohttp: change Hijacker to return a net.Conn
Brad Fitzpatrick [Mon, 7 Mar 2011 20:04:04 +0000 (12:04 -0800)]
http: change Hijacker to return a net.Conn

net.Conn is itself a io.ReadWriteCloser, so
most code should be unaffected.

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

14 years agohttp: fix cookie_test
Russ Cox [Mon, 7 Mar 2011 19:45:45 +0000 (14:45 -0500)]
http: fix cookie_test

Was only breaking on some dashboard builds because
not all run the network tests.

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

14 years agogo/ast, go/parser: populate identifier scopes at parse time
Robert Griesemer [Mon, 7 Mar 2011 19:01:23 +0000 (11:01 -0800)]
go/ast, go/parser: populate identifier scopes at parse time

The parser populates all scopes for a given file (except
type-related scopes for structs, interfaces, and methods
of types) at parse time.

A new parser flag, DeclarationErrors, enables error messages
related to declaration errors (as far as it is possible to
provide them).

The resulting AST has all (non-field, non-method) identifiers
resolved that can be resolved w/o doing imports or parsing
missing package files.

The ast.File node contains the (partially complete)
package scope and a list of unresolved global identifiers.

All type-specific data structures have been removed from the AST.

The existing typechecker is functional but needs to be adjusted
(simplified) accordingly. Utility functions to resolve all
identifiers for a package (after handling imports and parsing
all package files) are  missing.

Unrelated changes:
- Rename typechecker/testdata files to that they are not considered
  by gofmt.
- Minor cleanups/simplifications.

Parses all .go files in src and misc without declaration errors.
Runs all tests. Changes do not affect gofmt output.

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

14 years agomisc/dashboard/builder/doc.go: gofmt it
Robert Griesemer [Mon, 7 Mar 2011 19:00:57 +0000 (11:00 -0800)]
misc/dashboard/builder/doc.go: gofmt it

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