]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoXcode: move Xcode3 specific files into sub directory
Robert Griesemer [Fri, 2 Mar 2012 22:15:44 +0000 (14:15 -0800)]
Xcode: move Xcode3 specific files into sub directory

- makes space for Xcode4 files
- added README

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

13 years agofix build for FreeBSD/amd64
Shenghou Ma [Fri, 2 Mar 2012 20:47:42 +0000 (04:47 +0800)]
fix build for FreeBSD/amd64

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

13 years agold: allow more -L options
Shenghou Ma [Fri, 2 Mar 2012 20:14:31 +0000 (04:14 +0800)]
ld: allow more -L options
        Dynamically allocate the libdir array, so we won't need to bother it again.
        Enhances CL 5727043.

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

13 years agogo/printer: simpler exprList code, more tests
Robert Griesemer [Fri, 2 Mar 2012 19:16:05 +0000 (11:16 -0800)]
go/printer: simpler exprList code, more tests

Except for the tests, this is mostly deleting code:

- removed several exprListModes:
  blankStart: easily done explicitly, and trailing blanks
    are cleaned up by the trimmer post-pass
  blankEnd: never used
  commaSep: all exprLists calls had this set

- added test cases for multi-line returns
(for a later fix of issue 1207)

- no formatting changes

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

13 years agoall: more typos
Robert Griesemer [Fri, 2 Mar 2012 19:15:45 +0000 (11:15 -0800)]
all: more typos

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

13 years agonet: during short test, don't bother timeout longer than expected
Shenghou Ma [Fri, 2 Mar 2012 16:50:18 +0000 (00:50 +0800)]
net: during short test, don't bother timeout longer than expected

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

13 years agodoc/go1: minor corrections
Shenghou Ma [Fri, 2 Mar 2012 16:47:11 +0000 (00:47 +0800)]
doc/go1: minor corrections
        Set dagger looks very much like t in some fonts, so superscript it.
        os/signal is no longer in exp.

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

13 years agocmd/go: avoid repeated include dirs.
Rémy Oudompheng [Fri, 2 Mar 2012 16:31:13 +0000 (11:31 -0500)]
cmd/go: avoid repeated include dirs.

Fixes #3171.

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

13 years agodoc: fix some HTML errors in code.html
Sanjay Menakuru [Fri, 2 Mar 2012 16:29:09 +0000 (11:29 -0500)]
doc: fix some HTML errors in code.html

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

13 years agocmd/go: fix test import dependency bug
Russ Cox [Fri, 2 Mar 2012 16:27:36 +0000 (11:27 -0500)]
cmd/go: fix test import dependency bug

Fixes a problem Rob is having with goprotobuf.
Cannot add a test because the same case is more broken
when using ./ imports.  That still needs to be fixed,
and is one aspect of issue 3169.

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

13 years agocmd/go: fixes for gccgo.
Rémy Oudompheng [Fri, 2 Mar 2012 07:36:53 +0000 (08:36 +0100)]
cmd/go: fixes for gccgo.

Also remove useless "install" argument to pkgpath now that go/build
defines package install locations.

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

13 years agobuild: add GO_ prefix to LDFLAGS and GCFLAGS
Gustavo Niemeyer [Fri, 2 Mar 2012 05:45:01 +0000 (02:45 -0300)]
build: add GO_ prefix to LDFLAGS and GCFLAGS

Build environments will often define stock LDFLAGS
that are not compatible with the gc ld, causing
non-obvious failures midway through the build.

R=golang-dev, rsc, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5724044

13 years agoos: sleep 5ms after process has exited on windows
Alex Brainman [Fri, 2 Mar 2012 05:35:42 +0000 (16:35 +1100)]
os: sleep 5ms after process has exited on windows

Fixes #2866.

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

13 years agodoc: expand code.html to discuss the go tool in more depth
Andrew Gerrand [Fri, 2 Mar 2012 04:35:36 +0000 (15:35 +1100)]
doc: expand code.html to discuss the go tool in more depth

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

13 years agoos: implement UserTime/SystemTime on windows
Alex Brainman [Fri, 2 Mar 2012 03:47:40 +0000 (14:47 +1100)]
os: implement UserTime/SystemTime on windows

Fixes #3145.

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

13 years agoos: fix grammar in ProcessState comment
Rob Pike [Fri, 2 Mar 2012 03:07:26 +0000 (14:07 +1100)]
os: fix grammar in ProcessState comment
Asymptotic convergence.

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

13 years agoos: centralize documentation of Process and ProcessState
Russ Cox [Fri, 2 Mar 2012 02:56:54 +0000 (21:56 -0500)]
os: centralize documentation of Process and ProcessState

Also change Wait to say "exit" instead of "exit or stop".

I notice that Pid is not implemented on all systems.
Should we fix that?

Fixes #3138.

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

13 years agodoc: update go1 for html changes
Andrew Gerrand [Fri, 2 Mar 2012 00:52:46 +0000 (11:52 +1100)]
doc: update go1 for html changes

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

13 years agogo/build: fix build
Russ Cox [Fri, 2 Mar 2012 00:42:39 +0000 (19:42 -0500)]
go/build: fix build

Presumably something about the very large go/build
doc comment breaks the build constraint parser in
cmd/dist.  I don't feel like debugging C code right now,
so move it into its own file.  If cmd/dist decides doc.go
is not part of the package, it will still build correctly.

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

13 years agogo/build: document GOPATH
Russ Cox [Thu, 1 Mar 2012 23:26:53 +0000 (18:26 -0500)]
go/build: document GOPATH

Fixes #2332.

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

13 years agodoc: describe API changes to go/build
Russ Cox [Thu, 1 Mar 2012 23:17:28 +0000 (18:17 -0500)]
doc: describe API changes to go/build

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

13 years agocmd/go: fix verbose command displaying
Gustavo Niemeyer [Thu, 1 Mar 2012 23:14:21 +0000 (20:14 -0300)]
cmd/go: fix verbose command displaying

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

13 years agocmd/go: fix -I flag for gc command
Gustavo Niemeyer [Thu, 1 Mar 2012 23:13:04 +0000 (20:13 -0300)]
cmd/go: fix -I flag for gc command

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

13 years agoall: fixed various typos
Robert Griesemer [Thu, 1 Mar 2012 22:56:05 +0000 (14:56 -0800)]
all: fixed various typos

(Semi-automatically detected.)

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

13 years agoreflect: expand doc for Value.Interface
Russ Cox [Thu, 1 Mar 2012 22:55:47 +0000 (17:55 -0500)]
reflect: expand doc for Value.Interface

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

13 years agospec: clarifications around exports, uniqueness of identifiers
Robert Griesemer [Thu, 1 Mar 2012 21:57:49 +0000 (13:57 -0800)]
spec: clarifications around exports, uniqueness of identifiers

- Define what it means for two identifiers to be unique.

- The current spec is incorrect about exported
identifiers: for instance, it excluded fields
of non-exported types of exported variables
from being exported. It is easier to leave
the detailed specification away and let the
rest of the spec govern access of exported
identifiers.

- The current spec is incorrect about qualified
identifiers: It simply required that an identifier
be exported to be valid in a qualified identifier.
However, qualified identifiers can only access
exported identifiers declared in the package
block of the imported package.

Fixes #1551.

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

13 years agocmd/dist: Unix grammar fix
Russ Cox [Thu, 1 Mar 2012 18:38:05 +0000 (13:38 -0500)]
cmd/dist: Unix grammar fix

Fixes #3165.

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

13 years agospec: minor tweaks
Robert Griesemer [Thu, 1 Mar 2012 18:35:15 +0000 (10:35 -0800)]
spec: minor tweaks

- more idiomatic examples of pointer types
- show use of _ in examples of function types
- remove "legal:" qualification in examples
  for consistency

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

13 years agoencoding/xml: fix xml test tag usage
Gustavo Niemeyer [Thu, 1 Mar 2012 18:20:13 +0000 (15:20 -0300)]
encoding/xml: fix xml test tag usage

No real problem.

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

13 years agosync: add Once example
Dmitriy Vyukov [Thu, 1 Mar 2012 18:16:20 +0000 (22:16 +0400)]
sync: add Once example

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

13 years agosync: remove old WaitGroup example
Dmitriy Vyukov [Thu, 1 Mar 2012 17:26:08 +0000 (21:26 +0400)]
sync: remove old WaitGroup example
The docs look awkward - there is a paragraph
"For example:" with a plain text example,
and straight below it a real Example.

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

13 years agocmd/go: fixes
Russ Cox [Thu, 1 Mar 2012 17:12:22 +0000 (12:12 -0500)]
cmd/go: fixes
* Install tools into tool dir always
  (Fixes issue 3049.  Fixes issue 2868.  Fixes issue 2925.)
* Make packages depend on compiler, linker (Fixes issue 3036.)
* Do not recompile packages across roots (Fixes issue 3149.)
* Allow use of binary-only packages (Fixes issue 2775.)
* Avoid duplicate cgo dependencies (Fixes issue 3001.)
* Show less in go get -x.  (Fixes issue 2926.)
* Do not force repo root for existing checkout (Fixes issue 2969.)
* Show full syntax error list always (Fixes issue 2811.)
* Clean arguments before processing (Fixes issue 3034.)
* Add flags for compiler, linker arguments (Fixes issue 2996.)
* Pass flags in make.bash (Fixes issue 3091.)
* Unify build flags, defined in one place.
* Clean up error messages (Fixes issue 3075.  Fixes issue 2923.)
* Support local import paths (Fixes issue 3118.)
* Allow top-level package outside $GOPATH (Fixes issue 3009.)

In addition to these fixes, all commands now take a list of
go files as a way to specify a single package, just as go build and
go run always have.  This means you can:

        go list -json x.go
        go fix x.go
        go vet x.go
        go test x_test.go

Preliminary tests in test.bash.
Mainly testing things that the ordinary build does not.
I don't mind if the script doesn't run on Windows.

I expect that gccgo support is now broken, and I hope that
people will feel free to file issues and/or send CLs to fix it.  :-)

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

13 years agogo/build: replace FindTree, ScanDir, Tree, DirInfo with Import, Package
Russ Cox [Thu, 1 Mar 2012 17:12:09 +0000 (12:12 -0500)]
go/build: replace FindTree, ScanDir, Tree, DirInfo with Import, Package

This is an API change, but one I have been promising would
happen when it was clear what the go command needed.

This is basically a complete replacement of what used to be here.

build.Tree is gone.

build.DirInfo is expanded and now called build.Package.

build.FindTree is now build.Import(package, srcDir, build.FindOnly).
The returned *Package contains information that FindTree returned,
but applicable only to a single package.

build.ScanDir is now build.ImportDir.

build.FindTree+build.ScanDir is now build.Import.

The new Import API allows specifying the source directory,
in order to resolve local imports (import "./foo") and also allows
scanning of packages outside of $GOPATH.  They will come back
with less information in the Package, but they will still work.

The old go/build API exposed both too much and too little.
This API is much closer to what the go command needs,
and it works well enough in the other places where it is
used.  Path is gone, so it can no longer be misused.  (Fixes issue 2749.)

This CL updates clients of go/build other than the go command.
The go command changes are in a separate CL, to be submitted
at the same time.

R=golang-dev, r, alex.brainman, adg
CC=golang-dev
https://golang.org/cl/5713043

13 years agoreflect: make Value.Interface return immutable data
Russ Cox [Thu, 1 Mar 2012 16:48:27 +0000 (11:48 -0500)]
reflect: make Value.Interface return immutable data

Fixes #3134.

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

13 years agoruntime: run init on main thread
Russ Cox [Thu, 1 Mar 2012 16:48:17 +0000 (11:48 -0500)]
runtime: run init on main thread

Fixes #3125.

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/5714049

13 years agocmd/dist: recognize CC="ccache clang" as clang
Russ Cox [Thu, 1 Mar 2012 16:46:13 +0000 (11:46 -0500)]
cmd/dist: recognize CC="ccache clang" as clang

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

13 years agotest: add test of calling recover in a varargs function
Ian Lance Taylor [Thu, 1 Mar 2012 16:24:03 +0000 (08:24 -0800)]
test: add test of calling recover in a varargs function

gccgo did not handle this correctly.

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

13 years ago5g, 8g: remove documentation dregs
Anthony Martin [Thu, 1 Mar 2012 06:56:50 +0000 (22:56 -0800)]
5g, 8g: remove documentation dregs

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

13 years agodoc: update link to self-hosted "The Laws of Reflection" article
Shenghou Ma [Thu, 1 Mar 2012 06:54:35 +0000 (14:54 +0800)]
doc: update link to self-hosted "The Laws of Reflection" article

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

13 years agohtml/template: encoding/json does more escaping now, so update the html/template...
David Symonds [Thu, 1 Mar 2012 06:52:05 +0000 (17:52 +1100)]
html/template: encoding/json does more escaping now, so update the html/template test that uses it.

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

13 years agoencoding/json: escape output from Marshalers.
David Symonds [Thu, 1 Mar 2012 06:41:59 +0000 (17:41 +1100)]
encoding/json: escape output from Marshalers.

Fixes #3127.

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

13 years agoos: release process handle at the end of windows (*Process).Wait
Alex Brainman [Thu, 1 Mar 2012 06:36:35 +0000 (17:36 +1100)]
os: release process handle at the end of windows (*Process).Wait

Fixes #3154.

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

13 years agotest: add bug426.go: a gccgo crash on valid code
Ian Lance Taylor [Thu, 1 Mar 2012 05:51:21 +0000 (21:51 -0800)]
test: add bug426.go: a gccgo crash on valid code

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

13 years agoencoding/gob: more hardening for lengths of input strings.
David Symonds [Thu, 1 Mar 2012 04:57:54 +0000 (15:57 +1100)]
encoding/gob: more hardening for lengths of input strings.

Fixes #3160.

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

13 years agomisc/dist: implement binary distribution scripts in go
Andrew Gerrand [Thu, 1 Mar 2012 04:49:37 +0000 (15:49 +1100)]
misc/dist: implement binary distribution scripts in go

R=golang-dev, r, alex.brainman, r, mike.rosset
CC=golang-dev
https://golang.org/cl/5697050

13 years agotext/template: add examples that use multiple templates
Rob Pike [Thu, 1 Mar 2012 03:55:18 +0000 (14:55 +1100)]
text/template: add examples that use multiple templates

Fixes #2742.

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

13 years agotest: add a couple of cases to const1.go that crashed gccgo
Ian Lance Taylor [Thu, 1 Mar 2012 01:39:02 +0000 (17:39 -0800)]
test: add a couple of cases to const1.go that crashed gccgo

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

13 years agogo/printer, gofmt: improved comment placement
Robert Griesemer [Thu, 1 Mar 2012 01:25:15 +0000 (17:25 -0800)]
go/printer, gofmt: improved comment placement

Applied gofmt -w src misc (no changes).

Fixes #3147.

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

13 years agoio: Pipes and ReadAt are safe to use concurrently.
Rob Pike [Thu, 1 Mar 2012 00:24:13 +0000 (11:24 +1100)]
io: Pipes and ReadAt are safe to use concurrently.

Updates #1599.

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

13 years agodoc: add a bunch of missing <p> tags
Stefan Nilsson [Wed, 29 Feb 2012 23:07:52 +0000 (15:07 -0800)]
doc: add a bunch of missing <p> tags

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

13 years agodoc: add The Laws of Reflection article
Johan Euphrosine [Wed, 29 Feb 2012 23:05:51 +0000 (10:05 +1100)]
doc: add The Laws of Reflection article

Originally published on The Go Programming Language Blog, September 6, 2011.

http://blog.golang.org/2011/09/laws-of-reflection.html

Update #2547

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

13 years agonet: make -external flag for tests default to true
Mikio Hara [Wed, 29 Feb 2012 22:39:03 +0000 (07:39 +0900)]
net: make -external flag for tests default to true

go test -short # like in the build; no external stuff
go test # long tests, + external
go test -external=false # long tests, no external

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

13 years agogc: fix string comparisons for new bool rules
Anthony Martin [Wed, 29 Feb 2012 21:55:50 +0000 (13:55 -0800)]
gc: fix string comparisons for new bool rules

The two string comparison optimizations were
missing the implicit cast from ideal bool.

Fixes #3119.

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

13 years agopath/filepath: steer people away from HasPrefix
Russ Cox [Wed, 29 Feb 2012 21:37:40 +0000 (16:37 -0500)]
path/filepath: steer people away from HasPrefix

The strikes against it are:

1. It does not take path boundaries into account.
2. It assumes that Windows==case-insensitive file system
and non-Windows==case-sensitive file system, neither of
which is always true.
3. Comparing ToLower against ToLower is not a correct
implementation of a case-insensitive string comparison.
4. If it returns true on Windows you still don't know how long
the matching prefix is in bytes, so you can't compute what
the suffix is.

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

13 years agotime: skip a often-flaky test in short mode
Brad Fitzpatrick [Wed, 29 Feb 2012 21:14:05 +0000 (13:14 -0800)]
time: skip a often-flaky test in short mode

In -test.short mode, skip measuring the upper bound of time
sleeps. The API only guarantees minimum bounds on sleeps,
anyway, so this isn't a bug we're ignoring as much as it is
simply observing bad builder virtualization and/or loaded
machines.

We keep the test in full mode where developers will
presumably be running on a lightly-loaded, native, fast
machine.

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

13 years agospec: apply method sets, embedding to all types, not just named types
Russ Cox [Wed, 29 Feb 2012 20:54:06 +0000 (15:54 -0500)]
spec: apply method sets, embedding to all types, not just named types

When we first wrote the method set definition, we had long
discussions about whether method sets applied to all types
or just named types, and we (or at least I) concluded that it
didn't matter: the two were equivalent points of view, because
the only way to introduce a new method was to write a method
function, which requires a named receiver type.

However, the addition of embedded types changed this.
Embedding can introduce a method without writing an explicit
method function, as in:

        var x struct {
                sync.Mutex
        }

        var px *struct {
                sync.Mutex
        }

        var _, _ sync.Locker = &x, px

The edits in this CL make clear that both &x and px satisfy
sync.Locker.  Today, gccgo already works this way; 6g does not.

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

13 years agoos: diagnose chdir error during StartProcess
Russ Cox [Wed, 29 Feb 2012 20:53:57 +0000 (15:53 -0500)]
os: diagnose chdir error during StartProcess

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

13 years agopath/filepath: note that SplitList is different from strings.Split
Russ Cox [Wed, 29 Feb 2012 20:50:46 +0000 (15:50 -0500)]
path/filepath: note that SplitList is different from strings.Split

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

13 years agogc: disallow absolute import paths
Russ Cox [Wed, 29 Feb 2012 20:28:36 +0000 (15:28 -0500)]
gc: disallow absolute import paths

They are broken and hard to make work.

They have never worked: if you import "/tmp/x"
from "/home/rsc/p.c" then the compiler rewrites
this into import "/home/rsc/tmp/x", which is
clearly wrong.

Also we just disallowed the : character in import
paths, so import "c:/foo" is already not allowed.

Finally, in order to support absolute paths well in
a build tool we'd have to provide a mechanism to
instruct the compiler to resolve absolute imports
by looking in some other tree (where the binaries live)
and provide a mapping from absolute path to location
in that tree.  This CL avoids adding that complexity.

This is not part of the language spec (and should not be),
so no spec change is needed.

If we need to make them work later, we can.

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

13 years agospec: shorten heading for complex, real, imag
Russ Cox [Wed, 29 Feb 2012 20:20:11 +0000 (15:20 -0500)]
spec: shorten heading for complex, real, imag

In the current TOC it sticks out quite a bit.

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

13 years agonet/http/httptest: make Server.Close wait for outstanding requests to finish
Brad Fitzpatrick [Wed, 29 Feb 2012 20:18:26 +0000 (12:18 -0800)]
net/http/httptest: make Server.Close wait for outstanding requests to finish

Might fix issue 3050

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

13 years agoruntime/pprof: skip test on 64-bit Mac OS X 10.6
Shenghou Ma [Wed, 29 Feb 2012 19:11:37 +0000 (03:11 +0800)]
runtime/pprof: skip test on 64-bit Mac OS X 10.6

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

13 years agospec: use the term "lexical token" (rather then "lexical symbol")
Robert Griesemer [Wed, 29 Feb 2012 18:39:20 +0000 (10:39 -0800)]
spec: use the term "lexical token" (rather then "lexical symbol")

Fix for minor inconsistency.

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

13 years agodoc: elaborate available checks for cmd/vet
Shenghou Ma [Wed, 29 Feb 2012 18:22:35 +0000 (02:22 +0800)]
doc: elaborate available checks for cmd/vet

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

13 years agonet/http: make a test more paranoid & reliable on Windows, maybe.
Brad Fitzpatrick [Wed, 29 Feb 2012 17:53:20 +0000 (09:53 -0800)]
net/http: make a test more paranoid & reliable on Windows, maybe.

Part of diagnosing issue 3050.

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

13 years agonet/http: fix ProxyFromEnvironment bug, docs, add tests
Brad Fitzpatrick [Wed, 29 Feb 2012 17:52:52 +0000 (09:52 -0800)]
net/http: fix ProxyFromEnvironment bug, docs, add tests

Fixes #2919 I believe. (gets as far as sending a CONNECT
request to my little dummy logging proxy that doesn't actually
support CONNECT now.)  Untested with a real CONNECT-supporting
proxy, though.

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

13 years agonet/http/httputil: make https DumpRequestOut less racy
Brad Fitzpatrick [Wed, 29 Feb 2012 17:52:28 +0000 (09:52 -0800)]
net/http/httputil: make https DumpRequestOut less racy

It's still racy in that it mutates req.Body, though.  *shrug*

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

13 years agospec: fix sentence
Robert Griesemer [Wed, 29 Feb 2012 17:06:05 +0000 (09:06 -0800)]
spec: fix sentence

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

13 years agogob: trivial print fix
Robert Hencke [Wed, 29 Feb 2012 16:45:57 +0000 (08:45 -0800)]
gob: trivial print fix

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

13 years agogo/printer: replace multiline logic
Robert Griesemer [Wed, 29 Feb 2012 16:38:31 +0000 (08:38 -0800)]
go/printer: replace multiline logic

This CL mostly deletes code.

Using existing position information is
just as good to determine if a new section
is needed; no need to track exact multi-
line information. Eliminates the need to
carry around a multiLine parameter with
practically every function.

Applied gofmt -w src misc resulting in only
a minor change to godoc.go. In return, a couple
of test cases are now formatted better.

Not Go1-required, but nice-to-have as it will
simplify fixes going forward.

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

13 years agopkg/runtime: 2 sanity checks in the runtime-gdb.py prettyprinters.
Luuk van Dijk [Wed, 29 Feb 2012 15:42:25 +0000 (16:42 +0100)]
pkg/runtime: 2 sanity checks in the runtime-gdb.py prettyprinters.

Don't try to print obviously corrupt slices or interfaces.
Doesn't actually solve 3047 or 2818, but seems a good idea anyway.

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

13 years agonet: minor fixes to test
Mikio Hara [Wed, 29 Feb 2012 03:34:05 +0000 (12:34 +0900)]
net: minor fixes to test

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

13 years agoio: document that i/o is not necessarily safe for parallel access.
Rob Pike [Wed, 29 Feb 2012 02:30:08 +0000 (13:30 +1100)]
io: document that i/o is not necessarily safe for parallel access.

Updates #1599.

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

13 years agodoc: remove Go for C++ Programmers
Andrew Gerrand [Wed, 29 Feb 2012 02:23:07 +0000 (13:23 +1100)]
doc: remove Go for C++ Programmers

Now available at the Go Wiki:
http://code.google.com/p/go-wiki/wiki/GoForCPPProgrammers

Fixes #2913.

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

13 years agogo spec: inside functions, variables must be evaluated.
Robert Griesemer [Wed, 29 Feb 2012 01:44:24 +0000 (17:44 -0800)]
go spec: inside functions, variables must be evaluated.

Fixes #1612.

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

13 years agodoc: update Go For C++ Programmers
Ian Lance Taylor [Wed, 29 Feb 2012 00:49:57 +0000 (16:49 -0800)]
doc: update Go For C++ Programmers

Minor cleanups to look more like current Go.

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

13 years agodoc/go1: tweaks to address rsc's comments
Rob Pike [Wed, 29 Feb 2012 00:29:33 +0000 (11:29 +1100)]
doc/go1: tweaks to address rsc's comments

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

13 years agonet/http/httputil: fix DumpRequestOut on https URLs
Brad Fitzpatrick [Wed, 29 Feb 2012 00:03:32 +0000 (16:03 -0800)]
net/http/httputil: fix DumpRequestOut on https URLs

Don't try to do an SSL negotiation with a *bytes.Buffer.

Fixes #3135

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

13 years agonet: fix comment on Dial with unixgram
Mikio Hara [Tue, 28 Feb 2012 22:45:38 +0000 (07:45 +0900)]
net: fix comment on Dial with unixgram

We should use DialUnix or ListenPacket for unixgram networks
because Dial doesn't take a local UnixAddr.

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

13 years agodoc/style.css: make selectors more selective.
Stefan Nilsson [Tue, 28 Feb 2012 22:38:58 +0000 (09:38 +1100)]
doc/style.css: make selectors more selective.

Change #foo to div#foo to avoid selecting headings
with anchor foo, such as <h1 id="foo">.

(A more extensive change would be to use class
selectors for styling. Perhaps this is better, since id:s
should be unique within a document according to
http://www.w3.org/TR/CSS2/selector.html#id-selectors)

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

13 years agogo/build: move code around
Russ Cox [Tue, 28 Feb 2012 21:34:41 +0000 (16:34 -0500)]
go/build: move code around

Only copy+paste here.
Will make next code review's diffs a bit smaller.

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

13 years agoruntime/pprof: support OS X CPU profiling
Russ Cox [Tue, 28 Feb 2012 21:18:24 +0000 (16:18 -0500)]
runtime/pprof: support OS X CPU profiling

Work around profiling kernel bug with signal masks.
Still broken on 64-bit Snow Leopard kernel,
but I think we can ignore that one and let people
upgrade to Lion.

Add new trivial tools addr2line and objdump to take
the place of the GNU tools of the same name, since
those are not installed on OS X.

Adapt pprof to invoke 'go tool addr2line' and
'go tool objdump' if the system tools do not exist.

Clean up disassembly of base register on amd64.

Fixes #2008.

R=golang-dev, bradfitz, mikioh.mikioh, r, iant
CC=golang-dev
https://golang.org/cl/5697066

13 years agoall: remove various unused unexported functions and constants.
Rémy Oudompheng [Tue, 28 Feb 2012 20:48:03 +0000 (21:48 +0100)]
all: remove various unused unexported functions and constants.

R=golang-dev, minux.ma, rsc
CC=golang-dev, remy
https://golang.org/cl/5702050

13 years agonet/rpc: API changes, all documentation
Rob Pike [Tue, 28 Feb 2012 20:34:28 +0000 (07:34 +1100)]
net/rpc: API changes, all documentation
except for hiding one type that is only used internally.

Fixes #2944.

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

13 years agocmd/dist: force line-buffering stdout/stderr on Unix
Shenghou Ma [Tue, 28 Feb 2012 18:22:28 +0000 (02:22 +0800)]
cmd/dist: force line-buffering stdout/stderr on Unix
        If stdout and stderr are indeed the same file (not a tty), which is
        often the case, fully-buffered stdout will make it harder to see
        progresses, for example, ./make.bash 2>&1 | tee log

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

13 years agocrypto/tls: force OS X target version to 10.6 for API compatibility
Mikkel Krautz [Tue, 28 Feb 2012 16:34:48 +0000 (11:34 -0500)]
crypto/tls: force OS X target version to 10.6 for API compatibility

This is a band-aid until we can use weak imports with cgo.

Fixes #3131.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/5700083

13 years agoencoding/gob: fix "// +build" comment for debug.go
Shenghou Ma [Tue, 28 Feb 2012 05:39:42 +0000 (13:39 +0800)]
encoding/gob: fix "// +build" comment for debug.go

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

13 years agogotype: provide -comments flag
Robert Griesemer [Tue, 28 Feb 2012 05:35:26 +0000 (21:35 -0800)]
gotype: provide -comments flag

When debugging ASTs, it's useful to also
see the comments on occasion. Usage:

gotype -ast -comments file.go

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

13 years agogodoc: add Examples link to top-level index
Andrew Gerrand [Tue, 28 Feb 2012 05:05:12 +0000 (16:05 +1100)]
godoc: add Examples link to top-level index

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

13 years agotext/template: add example showing use of custom function
Rob Pike [Tue, 28 Feb 2012 04:50:41 +0000 (15:50 +1100)]
text/template: add example showing use of custom function

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

13 years agotext/template: fix redefinition bugs
Rob Pike [Tue, 28 Feb 2012 03:23:57 +0000 (14:23 +1100)]
text/template: fix redefinition bugs

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

13 years agotest: bug424: wrong embedded method called
Robert Griesemer [Tue, 28 Feb 2012 02:52:40 +0000 (18:52 -0800)]
test: bug424: wrong embedded method called

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

13 years agotutorial: delete
Rob Pike [Tue, 28 Feb 2012 02:35:58 +0000 (13:35 +1100)]
tutorial: delete
Instead we'll point people at the Tour and beef up code.html.

Fixes #3107.

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

13 years agonet: no panic on placeholders for netbsd
Mikio Hara [Tue, 28 Feb 2012 01:58:01 +0000 (10:58 +0900)]
net: no panic on placeholders for netbsd

Perhaps it might be better than panic.

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

13 years agoencoding/json: drop MarshalForHTML; gofix calls to Marshal.
David Symonds [Tue, 28 Feb 2012 00:41:16 +0000 (11:41 +1100)]
encoding/json: drop MarshalForHTML; gofix calls to Marshal.

I've elected to omit escaping the output of Marshalers for now.
I haven't thought through the implications of that;
I suspect that double escaping might be the undoing of that idea.

Fixes #3127.

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

13 years agonet: add stubs for NetBSD
Benny Siegert [Tue, 28 Feb 2012 00:28:10 +0000 (11:28 +1100)]
net: add stubs for NetBSD

This fixes the build of package net for GOOS=NetBSD.
Of course, a real implementation would be even better.

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

13 years agoos: fix NetBSD build
Benny Siegert [Tue, 28 Feb 2012 00:26:01 +0000 (11:26 +1100)]
os: fix NetBSD build

os.fileStat.Sys is no longer exported.

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

13 years agogobuilder: send commit time in RFC3339 format
Andrew Gerrand [Tue, 28 Feb 2012 00:21:56 +0000 (11:21 +1100)]
gobuilder: send commit time in RFC3339 format

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

13 years agoencoding/binary: better example
Brad Fitzpatrick [Mon, 27 Feb 2012 23:15:23 +0000 (10:15 +1100)]
encoding/binary: better example

leave that joke to Java.

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

13 years agoarchive/zip: use encoding/binary again, add readBuf helper
Andrew Gerrand [Mon, 27 Feb 2012 22:41:30 +0000 (09:41 +1100)]
archive/zip: use encoding/binary again, add readBuf helper

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