]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agotesting: scale benchmark precision to 0.01ns if needed
Russ Cox [Mon, 27 Jun 2011 22:50:27 +0000 (18:50 -0400)]
testing: scale benchmark precision to 0.01ns if needed

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

13 years agogc: avoid package name ambiguity in error messages
Russ Cox [Mon, 27 Jun 2011 22:44:30 +0000 (18:44 -0400)]
gc: avoid package name ambiguity in error messages

Fixes #2006.

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

13 years agohttp: add FileSystem interface, make FileServer use it
Brad Fitzpatrick [Mon, 27 Jun 2011 22:26:36 +0000 (15:26 -0700)]
http: add FileSystem interface, make FileServer use it

Permits serving from virtual filesystems, such as files linked
into a binary, or from a zip file.

Also adds a gofix for:

http.FileServer(root, prefix) -> http.StripPrefix(prefix, http.FileServer(http.Dir(root)))

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

13 years agobufio: do not cache Read errors
Graham Miller [Mon, 27 Jun 2011 20:12:04 +0000 (16:12 -0400)]
bufio: do not cache Read errors

Reader previously had cached an error from the underlying reader
and would return it on every subsequent call to Read.  The Reader
will now return the error only once, and subsequent calls will result
in a new Read call to the underlying Reader.

Fixes #1934.

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

13 years agosync: add benchmark for Once.
Dmitriy Vyukov [Mon, 27 Jun 2011 20:02:13 +0000 (16:02 -0400)]
sync: add benchmark for Once.

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

13 years ago8a: fixes for Plan 9 build
Lucio De Re [Mon, 27 Jun 2011 18:42:18 +0000 (14:42 -0400)]
8a: fixes for Plan 9 build

8a/a.h:
. Removed <u.h> and <libc.h> includes as they work better in "a.y".
. Made definition of EOF conditional as it's defined in the Plan 9
  header files, but not elsewhere.

8a/a.y:
. Added <u.h> and <libc.h> because <stdio.h> in Plan 9 needs them.
  Sequence <u.h>, <stdio.h>, <libc.h> recommended by RSC.

8a/lex.c:
. Added <u.h> and <libc.h> as now needed by "a.h".
. Dropped <ctype.h>.

cc/lexbody:
. exit() -> exits().
. Dropped unwanted incrementation.

cc/macbody:
. Adjusted a few format specifications.

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

13 years agold: elide the Go symbol table when using -s
Anthony Martin [Mon, 27 Jun 2011 18:39:38 +0000 (14:39 -0400)]
ld: elide the Go symbol table when using -s

R=rsc, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/4661050

13 years agobuild: use correct list of required programs
Russ Cox [Mon, 27 Jun 2011 18:30:02 +0000 (14:30 -0400)]
build: use correct list of required programs

R=golang-dev, bradfitz, go.peter.90
CC=golang-dev
https://golang.org/cl/4627068

13 years agohttp: add StripPrefix handler wrapper
Brad Fitzpatrick [Mon, 27 Jun 2011 18:03:43 +0000 (11:03 -0700)]
http: add StripPrefix handler wrapper

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

13 years agocodereview: make --ignore_hgpatch_failure work again
Russ Cox [Mon, 27 Jun 2011 17:45:17 +0000 (13:45 -0400)]
codereview: make --ignore_hgpatch_failure work again

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

13 years agohttp: do TLS handshake explicitly before copying TLS state
Brad Fitzpatrick [Mon, 27 Jun 2011 17:37:33 +0000 (10:37 -0700)]
http: do TLS handshake explicitly before copying TLS state

Previously we were snapshotting the TLS state into *Request
before we did the HTTP ReadRequest, the first Read of which
triggered the TLS handshake implicitly.

Fixes #1956

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

13 years agogotest: add -test.benchtime and -test.cpu flags.
Dmitriy Vyukov [Mon, 27 Jun 2011 17:31:40 +0000 (13:31 -0400)]
gotest: add -test.benchtime and -test.cpu flags.
-test.benchtime allows to specify benchmark execution time.
-test.cpu allows to execute tests/benchmarks for several
values of GOMAXPROCS.

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

13 years ago5l, 6l, 8l: drop use of ed during build
Russ Cox [Mon, 27 Jun 2011 16:03:19 +0000 (12:03 -0400)]
5l, 6l, 8l: drop use of ed during build

build runs with chmod 0 /bin/ed now

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

13 years agosyscall: regenerate zerrors for darwin/linux/freebsd
Russ Cox [Mon, 27 Jun 2011 15:02:32 +0000 (11:02 -0400)]
syscall: regenerate zerrors for darwin/linux/freebsd

did darwin on mac with older, not broken xcode.
did linux arm by copying diffs from linux 386.
did freebsd amd64 by copying diffs from freebsd 386.

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

13 years agocrypto: replace "crypto/block" with "crypto/cipher" in comments
Dmitry Chestnykh [Mon, 27 Jun 2011 13:16:42 +0000 (09:16 -0400)]
crypto: replace "crypto/block" with "crypto/cipher" in comments

Documentation mentioned the obsolete package "crypto/block",
which has been replaced with "crypto/cipher".

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

13 years agogofix: fixes for path/filepath changes
Robert Hencke [Sun, 26 Jun 2011 01:24:28 +0000 (11:24 +1000)]
gofix: fixes for path/filepath changes

Fixes #1970.

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

13 years agogofix: fixes for sort changes
Robert Hencke [Sat, 25 Jun 2011 22:48:53 +0000 (08:48 +1000)]
gofix: fixes for sort changes

Fixes #1969.

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

13 years agoebnflint: better handling of stdin
Robert Griesemer [Sat, 25 Jun 2011 00:29:19 +0000 (17:29 -0700)]
ebnflint: better handling of stdin

- don't rely on /dev/stdin as the name for standard input
- employ EBNF extraction if the source contains tags

"cat source.html | ebnflint" works now

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

13 years agofmt: Added SkipSpace() function to fmt's ScanState interface.
Michael T. Jones [Sat, 25 Jun 2011 00:26:45 +0000 (17:26 -0700)]
fmt: Added SkipSpace() function to fmt's ScanState interface.

Users of the Scan() infrastructure that employ ReadRune() rather than
Token() need a way to skip leading spaces and newlines as set by the
the parent, Fscan(), Fscanln, or Fscanf(). As the internal methods and
boolean flags are not exported, this new function was added here and
in the Int and Nat Scan() functions of the big package. (fmt.Rat did
not need change since it uses Token()) Also added Printf style format
code support to int types and tests for same to int_test.go

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

13 years agohttp: better handling of 0-length Request.Body
Brad Fitzpatrick [Fri, 24 Jun 2011 23:46:14 +0000 (16:46 -0700)]
http: better handling of 0-length Request.Body

As rsc suggested after change 58a6bdac3d12 was committed, we
now read the first byte of Request.Body when the
Request.ContentLength is 0 to disambiguate between a truly
zero-length body and a body of unknown length where the user
didn't set the ContentLength field.

This was also causing the reverse proxy problem where incoming
requests (which always have a body, of private type http.body,
even for 0-lengthed requests) were being relayed to the http
Transport for fetching, which was serializing the request as a
chunked request (since ContentLength was 0 and Body was
non-nil)

Fixes #1999

R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/4628063

13 years agohttp: assume ContentLength 0 on GET requests
Brad Fitzpatrick [Fri, 24 Jun 2011 20:48:12 +0000 (13:48 -0700)]
http: assume ContentLength 0 on GET requests

Incremental step in fix for issue 1999

R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/4667041

13 years agomime: lower-case media type parameters
Pascal S. de Kloe [Fri, 24 Jun 2011 18:32:06 +0000 (11:32 -0700)]
mime: lower-case media type parameters
        RFC 1521 section 4 states "The type, subtype, and parameter names are not case sensitive.".

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

13 years agoos: remove duplicate package description
Robert Hencke [Fri, 24 Jun 2011 18:23:49 +0000 (11:23 -0700)]
os: remove duplicate package description

file.go contains a more complete package description.

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

13 years agomisc/emacs: update list of builtins.
Quan Yong Zhai [Fri, 24 Jun 2011 18:19:48 +0000 (11:19 -0700)]
misc/emacs: update list of builtins.

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

13 years agopath/filepath: enable TestWalk to run on windows
Alex Brainman [Fri, 24 Jun 2011 09:18:59 +0000 (19:18 +1000)]
path/filepath: enable TestWalk to run on windows

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

13 years agotag weekly.2011-06-23
Andrew Gerrand [Fri, 24 Jun 2011 06:18:39 +0000 (16:18 +1000)]
tag weekly.2011-06-23

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

13 years agoweekly.2011-06-23 weekly.2011-06-23
Andrew Gerrand [Fri, 24 Jun 2011 06:04:17 +0000 (16:04 +1000)]
weekly.2011-06-23

R=golang-dev, robert.hencke, r
CC=golang-dev
https://golang.org/cl/4625062

13 years agoos: fixed PathListSeparator to ';' for windows.
Yasuhiro Matsumoto [Fri, 24 Jun 2011 05:00:59 +0000 (15:00 +1000)]
os: fixed PathListSeparator to ';' for windows.
Fixed issue 1992

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/4661047

13 years agohttp: buffer Request.Write
Brad Fitzpatrick [Fri, 24 Jun 2011 04:10:51 +0000 (21:10 -0700)]
http: buffer Request.Write

Fixes #1996

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

13 years agoruntime: don't use twice the memory with grsec-like kernels
Gustavo Niemeyer [Fri, 24 Jun 2011 03:29:59 +0000 (00:29 -0300)]
runtime: don't use twice the memory with grsec-like kernels

grsec needs the FIXED flag to be provided to mmap, which
works now.  That said, when the allocation fails to be made
in the specific address, we're still given back a writable
page.  This change will unmap that page to avoid using
twice the amount of memory needed.

It'd also be pretty easy to avoid the extra system calls
once we detected that the flag is needed, but I'm not sure
if that edge case is worth the effort.

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

13 years agogoinstall: build with make by default, add -make flag
Andrew Gerrand [Fri, 24 Jun 2011 03:01:17 +0000 (13:01 +1000)]
goinstall: build with make by default, add -make flag

This is a temporary measure until go/build can build cgo packages.

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

13 years agomime/multipart: remove newline at top of the multipart.
Yasuhiro Matsumoto [Thu, 23 Jun 2011 17:11:33 +0000 (10:11 -0700)]
mime/multipart: remove newline at top of the multipart.

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

13 years agolibmach: fix disassembly of FCMOVcc and FCOMI
Anthony Martin [Thu, 23 Jun 2011 13:32:29 +0000 (09:32 -0400)]
libmach: fix disassembly of FCMOVcc and FCOMI

The optable for 0xDB is handled specially.

This was the cause of a really weird bug
when using cov (386!) on the math package.

A real head-scratcher.

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

13 years agolibmach: fix tracing on linux (for cov)
Anthony Martin [Thu, 23 Jun 2011 03:24:14 +0000 (23:24 -0400)]
libmach: fix tracing on linux (for cov)

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

13 years ago5c: do not use R9 and R10
Russ Cox [Thu, 23 Jun 2011 03:22:36 +0000 (23:22 -0400)]
5c: do not use R9 and R10

This program used to use R9 and R10.
Now it fails to compile (out of registers).
I used to know a simpler test but can't remember it.

Learned something new: Rietveld refuses change
list descriptions bigger than 10 kB.

int sum(int x, int y, int z, int w) {
        return
        (((((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))))%
        (((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))))*
        ((((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))))%
        (((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))))))*
        (((((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))))%
        (((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))))*
        ((((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))))%
        (((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))))/
        ((((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))|
        (((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w))&
        ((x*y+z*w|x*y+z*w)^
        (x*y+z*w|x*y+z*w)))))))
        ;
}

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

13 years agoexec: LookPath should not search %PATH% for files like c:cmd.exe
Alex Brainman [Thu, 23 Jun 2011 00:56:53 +0000 (10:56 +1000)]
exec: LookPath should not search %PATH% for files like c:cmd.exe

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

13 years agoexp/template: make -0 be an unsigned int.
Rob Pike [Thu, 23 Jun 2011 00:19:29 +0000 (10:19 +1000)]
exp/template: make -0 be an unsigned int.
Fix (inconsequential) type error in list initializer.

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

13 years agogo/build: include Import objects in Script Inputs
Andrew Gerrand [Thu, 23 Jun 2011 00:15:46 +0000 (10:15 +1000)]
go/build: include Import objects in Script Inputs

This has the effect of making goinstall rebuild a package's
dependencies when they are newer than the current package object.

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

13 years agonet, syscall: interface for windows
Yasuhiro Matsumoto [Wed, 22 Jun 2011 23:54:57 +0000 (09:54 +1000)]
net, syscall: interface for windows

R=mikioh.mikioh, alex.brainman, rsc, vincent.vanackere
CC=golang-dev
https://golang.org/cl/4590050

13 years agoio: clarify Read, ReadAt, Copy, Copyn EOF behavior
Russ Cox [Wed, 22 Jun 2011 23:33:07 +0000 (19:33 -0400)]
io: clarify Read, ReadAt, Copy, Copyn EOF behavior

R=golang-dev, bradfitz, iant, dsymonds, nigeltao, r
CC=golang-dev
https://golang.org/cl/4629062

13 years agoFirst cut at the parser for the new template package.
Rob Pike [Wed, 22 Jun 2011 23:27:28 +0000 (09:27 +1000)]
First cut at the parser for the new template package.

This is not a full grammar, but the pieces are there to implement whatever we converge on.

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

13 years agoexec: better error message for windows LookPath
Alex Brainman [Wed, 22 Jun 2011 23:16:20 +0000 (09:16 +1000)]
exec: better error message for windows LookPath

Fixes #1991.

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

13 years agoimage: basic test for the 16-bits-per-color-channel types.
Nigel Tao [Wed, 22 Jun 2011 22:39:00 +0000 (08:39 +1000)]
image: basic test for the 16-bits-per-color-channel types.

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

13 years agosyscall: add tty support to StartProcess
Ken Rockot [Wed, 22 Jun 2011 22:07:20 +0000 (18:07 -0400)]
syscall: add tty support to StartProcess

These changes add a Ctty int field to the Unix syscall.ProcAttr which,
if set >= 0 in conjuction with Setsid=true, will be used by
forkAndExecInChild as the file descriptor for the new child's
controlling terminal.

Necessary changes have been made to mkerrors.sh to generate defs for
TIOC*, though changes to its output files are not included here.
The changes made should support Linux, FreeBSD and Darwin, at least.

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

13 years agoA+C: Ken Rockot (individual CLA)
Russ Cox [Wed, 22 Jun 2011 22:07:08 +0000 (18:07 -0400)]
A+C: Ken Rockot (individual CLA)

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

13 years agobuild: explain $PWD use
Russ Cox [Wed, 22 Jun 2011 21:00:46 +0000 (17:00 -0400)]
build: explain $PWD use

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

13 years agosync: restore GOMAXPROCS during benchmarks
Dmitriy Vyukov [Wed, 22 Jun 2011 20:20:37 +0000 (16:20 -0400)]
sync: restore GOMAXPROCS during benchmarks

R=golang-dev
CC=dvyukov, golang-dev
https://golang.org/cl/4631060

13 years agold: don't attempt to build dynamic sections unnecessarily
Gustavo Niemeyer [Wed, 22 Jun 2011 19:12:22 +0000 (15:12 -0400)]
ld: don't attempt to build dynamic sections unnecessarily

This prevents ld from generating zeroed symtab entries for
sections that aren't going to be generated because dynamic
linkage has been disabled (-d was used or no dynamic libs
were seen).  Even though they were not explicitly added by
doelf, the section creation process was making them
reachable again.

The windows head is being disconsidered for this because
apparently it's not taking into account debug['d'].

This makes elflint 0.1% happier.

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

13 years agoFix Windows build; ErrorString->NewError
Brad Fitzpatrick [Wed, 22 Jun 2011 18:33:30 +0000 (11:33 -0700)]
Fix Windows build; ErrorString->NewError

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

13 years agoos.Error API: don't export os.ErrorString, use os.NewError consistently
Robert Griesemer [Wed, 22 Jun 2011 17:52:47 +0000 (10:52 -0700)]
os.Error API: don't export os.ErrorString, use os.NewError consistently

This is a core API change.

1) gofix misc src
2) Manual adjustments to the following files under src/pkg:
   gob/decode.go
   rpc/client.go
   os/error.go
   io/io.go
   bufio/bufio.go
   http/request.go
   websocket/client.go
as well as:
   src/cmd/gofix/testdata/*.go.in (reverted)
   test/fixedbugs/bug243.go
3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go)

Compiles and runs all tests.

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

13 years agogodefs: remove test from build
Russ Cox [Wed, 22 Jun 2011 01:45:13 +0000 (21:45 -0400)]
godefs: remove test from build

The test is only defined on darwin/amd64, and it fails
with recent versions of Xcode, which do not support
-gstabs+ debugging output.  At some point godefs will
have to be replaced, perhaps merged with cgo.
Godefs is not needed during builds anyway (its output files
are checked into the repository in src/pkg/runtime),
so its failure on the newer Xcode is a distraction from an
otherwise usable build.  Disable the test.

Fixes #1985.

R=golang-dev, gri, robert.hencke, r
CC=golang-dev
https://golang.org/cl/4638053

13 years agocrypto/openpgp: add ElGamal support.
Adam Langley [Wed, 22 Jun 2011 01:00:49 +0000 (21:00 -0400)]
crypto/openpgp: add ElGamal support.

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

13 years ago8l: more fixes for Plan 9
Lucio De Re [Tue, 21 Jun 2011 16:14:32 +0000 (12:14 -0400)]
8l: more fixes for Plan 9

Once these changes are effected, it is possible to construct
"8l" native on a (386?) Plan 9 system, albeit with assistance
from modules such as mkfiles that are not (yet) included in any
public patches.

8l/asm.c:
. Corrected some format qualifiers.

8l/list.c:
. Cast a print() argument to (int) to match the given format.
  It may be possible to change the format (%R), but I have not
  looked into it.

8l/obj.c:
. Removed some unused code.

8l/span.c:
. Removed unnecessary incrementation on "bp".
. Corrected some format qualifiers.

ld/data.c:
. Corrected some format qualifiers.
. Cast print argument to (int): used as field size.
. Use braces to suppress warning about empty if() statements.

ld/dwarf.c:
. Trivial spelling mistake in comment.

ld/ldelf.c:
. Added USED() statements to silence warnings.
. Dropped redundant address (&) operators.
. corrected some format qualifiers.
. Cast to (int) for switch selection variable.

ld/macho.c:
. Added USED() statements to silence warnings.

ld/ldpe.c:
. Added USED() statements to silence warnings.
. More careful use of "sect" variable.
. Corrected some format qualifiers.
. Removed redundant assignments.
. Minor fix dropped as it was submitted separately.

ld/pe.c:
. Dropped <time.h> which is now in <u.h>.
. Dropped redundant address (&) operators.
. Added a missing variable initialisation.

ld/symtab.c:
. Added USED() statements to silence warnings.
. Removed redundant incrementation.
. Corrected some format qualifiers.

All the above have been tested against a (very) recent release
and do not seem to trigger any regressions.

All review suggestions have been incorporated.

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

13 years agonacl, tiny: remove vestiges
Robert Hencke [Tue, 21 Jun 2011 16:02:40 +0000 (12:02 -0400)]
nacl, tiny: remove vestiges

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

13 years agogopprof: update list of memory allocators
Russ Cox [Tue, 21 Jun 2011 15:27:08 +0000 (11:27 -0400)]
gopprof: update list of memory allocators

Also import new weblist command from Google version.

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

13 years agogoinstall: undo 1ad616fb313d (always rebuild...)
Andrew Gerrand [Tue, 21 Jun 2011 07:13:16 +0000 (17:13 +1000)]
goinstall: undo 1ad616fb313d (always rebuild...)

CL 4627051 is a better way of doing the same thing.

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

13 years agobuilder: run make single-threaded on windows
Alex Brainman [Tue, 21 Jun 2011 02:26:38 +0000 (12:26 +1000)]
builder: run make single-threaded on windows

Will still honor MAKEFLAGS environment variable if set.

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

13 years agogoinstall: undo repo peeking code
Andrew Gerrand [Tue, 21 Jun 2011 01:28:15 +0000 (11:28 +1000)]
goinstall: undo repo peeking code

Keeping the Julian's good refactoring work.

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

13 years agoEffective Go: supplied missing type in variadic function example.
Ben Lynn [Tue, 21 Jun 2011 00:55:07 +0000 (10:55 +1000)]
Effective Go: supplied missing type in variadic function example.

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

13 years agosyscall: add socket control message support for darwin, freebsd, linux
Mikio Hara [Mon, 20 Jun 2011 22:40:20 +0000 (18:40 -0400)]
syscall: add socket control message support for darwin, freebsd, linux

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

13 years agofmt: catch panics from calls to String etc.
Rob Pike [Mon, 20 Jun 2011 22:31:02 +0000 (08:31 +1000)]
fmt: catch panics from calls to String etc.

This change causes Print et al. to catch panics generated by
calls to String, GoString, and Format.  The panic is formatted
into the output stream as an error, but the program continues.
As a special case, if the argument was a nil pointer, the
result is just "<nil>", because that's almost certainly enough
information and handles the very common case of String
methods that don't guard against nil.

Scan does not want this change. Input must work; output can
be for debugging and it's nice to get output even when you
make a mistake.

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

13 years agoall-qemu.bash: cannot test go/build
Russ Cox [Mon, 20 Jun 2011 21:44:36 +0000 (17:44 -0400)]
all-qemu.bash: cannot test go/build

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

13 years agohttp: write Header keys with empty values
Brad Fitzpatrick [Mon, 20 Jun 2011 21:36:03 +0000 (14:36 -0700)]
http: write Header keys with empty values

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

13 years agohttp: permit handlers to explicitly remove the Date header
Brad Fitzpatrick [Mon, 20 Jun 2011 20:39:03 +0000 (13:39 -0700)]
http: permit handlers to explicitly remove the Date header

We'll do the right thing by default, but people wanting minimal
response sizes can explicitly remove the Date header.
(empty fields aren't written out)

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

13 years agoos: change Waitmsg String method to use pointer receiver
Graham Miller [Mon, 20 Jun 2011 19:42:17 +0000 (15:42 -0400)]
os: change Waitmsg String method to use pointer receiver

Fixes #1851.

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

13 years agohttp: add Server.ListenAndServeTLS
Brad Fitzpatrick [Mon, 20 Jun 2011 19:19:26 +0000 (12:19 -0700)]
http: add Server.ListenAndServeTLS

Fixes #1964

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

13 years agosyscall: add LSF support for linux
Mikio Hara [Mon, 20 Jun 2011 18:51:34 +0000 (14:51 -0400)]
syscall: add LSF support for linux

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

13 years agocodereview.py: note that hg change -d abandons a change list
Robert Hencke [Mon, 20 Jun 2011 18:50:00 +0000 (14:50 -0400)]
codereview.py: note that hg change -d abandons a change list

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

13 years ago5g, 6g, 8g: fix comments in method call generation
Anthony Martin [Mon, 20 Jun 2011 18:49:29 +0000 (14:49 -0400)]
5g, 6g, 8g: fix comments in method call generation

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

13 years ago5g, 5l: fix more set but not used warnings
Anthony Martin [Mon, 20 Jun 2011 18:18:04 +0000 (14:18 -0400)]
5g, 5l: fix more set but not used warnings

These are present when building with gcc 4.6.

R=golang-dev, dave
CC=golang-dev, lvd
https://golang.org/cl/4636047

13 years agotest: test of goto restrictions
Russ Cox [Mon, 20 Jun 2011 18:06:00 +0000 (14:06 -0400)]
test: test of goto restrictions

R=gri, iant, bradfitz, fvbommel, r
CC=golang-dev
https://golang.org/cl/4652041

13 years agohttp: fix req.Cookie(name) with cookies in one header
Brad Fitzpatrick [Mon, 20 Jun 2011 17:33:07 +0000 (10:33 -0700)]
http: fix req.Cookie(name) with cookies in one header

Fixes #1974

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

13 years agomime: fix RFC references
Pascal S. de Kloe [Mon, 20 Jun 2011 14:41:18 +0000 (07:41 -0700)]
mime: fix RFC references

R=golang-dev, bradfitz
CC=brad fitzpatrick <bradfitz, golang-dev
https://golang.org/cl/4634063

13 years agobuild: exclude packages that fail on Plan 9 (for now)
Anthony Martin [Mon, 20 Jun 2011 12:23:43 +0000 (22:23 +1000)]
build: exclude packages that fail on Plan 9 (for now)

All but two packages depend on net:
        debug/proc
        os/signal

With this change, we can produce
a working build with GOOS=plan9.

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

13 years agogoinstall: update doc.go
Andrew Gerrand [Mon, 20 Jun 2011 06:39:16 +0000 (16:39 +1000)]
goinstall: update doc.go

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

13 years agomisc/godashboard: Accept sub-directories for goinstall's report.
Yasuhiro Matsumoto [Mon, 20 Jun 2011 04:46:32 +0000 (14:46 +1000)]
misc/godashboard: Accept sub-directories for goinstall's report.
Fixed issue 1155.

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

13 years agogoinstall: s/vlogf/printf/
Andrew Gerrand [Mon, 20 Jun 2011 04:44:14 +0000 (14:44 +1000)]
goinstall: s/vlogf/printf/

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

13 years agogoinstall: wait for all commands to finish instead of timeout
Andrew Gerrand [Mon, 20 Jun 2011 04:12:23 +0000 (14:12 +1000)]
goinstall: wait for all commands to finish instead of timeout
goinstall: make ".git" repo suffix optional

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

13 years agoexec: add support for Plan 9
Anthony Martin [Mon, 20 Jun 2011 03:34:10 +0000 (13:34 +1000)]
exec: add support for Plan 9

R=paulzhol, mirtchovski, fshahriar, alex.brainman, r
CC=golang-dev
https://golang.org/cl/4386041

13 years agogoinstall: Add support for arbitary code repositories
Julian Phillips [Mon, 20 Jun 2011 03:00:43 +0000 (13:00 +1000)]
goinstall: Add support for arbitary code repositories

Extend goinstall to support downloading from any hg/git/svn/bzr hosting
site, not just the standard ones.  The type of hosting is automatically
checked by trying all the tools, so the import statement looks like:

  import "example.com/mything"

Which will work for Mercurial (http), Subversion (http, svn), Git (http,
git) and Bazaar (http, bzr) hosting.

All the existing package imports will work through this new mechanism,
but the existing hard-coded host support is left in place to ensure
there is no change in behaviour.

R=golang-dev, bradfitz, fvbommel, go.peter.90, n13m3y3r, adg, duperray.olivier
CC=golang-dev
https://golang.org/cl/4650043

13 years agodoc/GoCourseDay1: shrink the PDF by rewriting it using ps2pdf.
Rob Pike [Mon, 20 Jun 2011 02:36:14 +0000 (12:36 +1000)]
doc/GoCourseDay1: shrink the PDF by rewriting it using ps2pdf.
No difference in content or appearance.
Forgot to do this when I updated this file a few days ago.

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

13 years agogodefs: rudimentary tests
Robert Hencke [Mon, 20 Jun 2011 01:54:07 +0000 (11:54 +1000)]
godefs: rudimentary tests

currently only defined for darwin

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

13 years ago8a: delete dreg l.s
Rob Pike [Mon, 20 Jun 2011 01:53:41 +0000 (11:53 +1000)]
8a: delete dreg l.s

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

13 years agotime: add support for Plan 9
Anthony Martin [Sun, 19 Jun 2011 06:36:33 +0000 (16:36 +1000)]
time: add support for Plan 9

R=paulzhol, mirtchovski, r, r, rsc
CC=golang-dev
https://golang.org/cl/4362041

13 years agoA+C: add Julian Phillips
Andrew Gerrand [Sun, 19 Jun 2011 06:09:28 +0000 (16:09 +1000)]
A+C: add Julian Phillips

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

13 years agoMake.ccmd: another build fix.
Rob Pike [Sun, 19 Jun 2011 05:30:54 +0000 (15:30 +1000)]
Make.ccmd: another build fix.
It's sad to think there are environments where compiling against a library
isn't enough information for the the linker to decide that you need that
library.
TBR=jdpoirier

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

13 years agoMake.ccmd: fix build - libraries in wrong order.
Rob Pike [Sun, 19 Jun 2011 04:56:25 +0000 (14:56 +1000)]
Make.ccmd: fix build - libraries in wrong order.
TBR=jdpoirier

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

13 years agocc: nit: silence comment warnings
Dave Cheney [Sun, 19 Jun 2011 03:58:08 +0000 (13:58 +1000)]
cc: nit: silence comment warnings

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

13 years agoMake.ccmd: link with mach lib,
Joe Poirier [Sun, 19 Jun 2011 03:57:22 +0000 (13:57 +1000)]
Make.ccmd: link with mach lib,
remove explicit linking in make files

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

13 years agodoc/faq: remove misleading FAQ entry
Andrew Gerrand [Sun, 19 Jun 2011 03:53:07 +0000 (13:53 +1000)]
doc/faq: remove misleading FAQ entry

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

13 years agogoinstall: always rebuild a package after its dependencies are built
Andrew Gerrand [Sat, 18 Jun 2011 23:36:45 +0000 (09:36 +1000)]
goinstall: always rebuild a package after its dependencies are built

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

13 years agohttp: fix documentation typo
Scott Lawrence [Sat, 18 Jun 2011 11:53:18 +0000 (21:53 +1000)]
http: fix documentation typo
(Variable is referred to alternately as 'r' and 'req')

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

13 years agodoc/faq: add question about converting from []T to []interface{}
Andrew Gerrand [Sat, 18 Jun 2011 10:31:38 +0000 (20:31 +1000)]
doc/faq: add question about converting from []T to []interface{}

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

13 years agosyscall: fix build for Sizeof change
Russ Cox [Fri, 17 Jun 2011 21:07:21 +0000 (17:07 -0400)]
syscall: fix build for Sizeof change

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

13 years agogc: unsafe.Alignof, unsafe.Offsetof, unsafe.Sizeof now return uintptr
Russ Cox [Fri, 17 Jun 2011 20:12:14 +0000 (16:12 -0400)]
gc: unsafe.Alignof, unsafe.Offsetof, unsafe.Sizeof now return uintptr

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

13 years ago5g, 8g: fix build
Russ Cox [Fri, 17 Jun 2011 20:05:00 +0000 (16:05 -0400)]
5g, 8g: fix build

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

13 years agogc: implement goto restriction
Russ Cox [Fri, 17 Jun 2011 19:25:05 +0000 (15:25 -0400)]
gc: implement goto restriction

Remove now-unnecessary zeroing of stack frames.

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

13 years agogc: descriptive panic for nil pointer -> value method call
Russ Cox [Fri, 17 Jun 2011 19:23:27 +0000 (15:23 -0400)]
gc: descriptive panic for nil pointer -> value method call

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

13 years agospec: disallow goto into blocks
Russ Cox [Fri, 17 Jun 2011 16:49:04 +0000 (12:49 -0400)]
spec: disallow goto into blocks

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

13 years agorespect goto restrictions
Russ Cox [Fri, 17 Jun 2011 10:07:13 +0000 (06:07 -0400)]
respect goto restrictions

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