]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogc: Escape analysis.
Luuk van Dijk [Wed, 24 Aug 2011 17:07:08 +0000 (19:07 +0200)]
gc: Escape analysis.

For now it's switch-on-and-offable with -s, and the effects can be inspected
with -m.  Defaults are the old codepaths.

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

13 years agogodoc: use virtual file system when generating package synopses
Robert Griesemer [Wed, 24 Aug 2011 16:52:16 +0000 (09:52 -0700)]
godoc: use virtual file system when generating package synopses

Fix for godoc on app engine.

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

13 years agotest: put GOROOT/bin before all others in run
Luuk van Dijk [Wed, 24 Aug 2011 14:12:20 +0000 (16:12 +0200)]
test: put GOROOT/bin before all others in run

If you installed a 6g in /usr/bin it interferes
with test/run otherwise.

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

13 years agohttp: adjust test threshold for larger suse buffers
Brad Fitzpatrick [Wed, 24 Aug 2011 12:09:49 +0000 (16:09 +0400)]
http: adjust test threshold for larger suse buffers

My theory is that suse has larger TCP buffer sizes
by default.  I now check over 100MB, rather than over 2MB.
100MB is ~halfway between the 1MB limit and the 200MB
request that's attempted.

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

13 years agohttp: on invalid request, send 400 response
Brad Fitzpatrick [Wed, 24 Aug 2011 09:10:22 +0000 (13:10 +0400)]
http: on invalid request, send 400 response

Fixes #2160

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

13 years agoexp/norm: Reduced the size of the byte buffer used by reorderBuffer by half by reusin...
Marcel van Lohuizen [Wed, 24 Aug 2011 09:05:45 +0000 (11:05 +0200)]
exp/norm: Reduced the size of the byte buffer used by reorderBuffer by half by reusing space when combining.

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

13 years agoreflect: add Value.Bytes, Value.SetBytes methods
Russ Cox [Wed, 24 Aug 2011 02:50:08 +0000 (22:50 -0400)]
reflect: add Value.Bytes, Value.SetBytes methods

This allows code that wants to handle
[]byte separately to get at the actual slice
instead of just at individual bytes.
It seems to come up often enough.

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

13 years agogo/build: add test support & use in gotest
Russ Cox [Wed, 24 Aug 2011 02:45:30 +0000 (22:45 -0400)]
go/build: add test support & use in gotest

A side-effect is that, just like foo_386.go
is only built on 386, foo_386_test.go is only
built for testing on 386.

R=adg, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4942050

13 years agogobuilder: increase log limit
Russ Cox [Wed, 24 Aug 2011 02:39:39 +0000 (22:39 -0400)]
gobuilder: increase log limit

It's a balance between fetching too much
and falling far enough behind that you can't
catch up.  We missed 20 commits in a row
when the builders were down for a few days.
This gives us a little more leeway.

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

13 years agohttp: delete error kludge
Russ Cox [Wed, 24 Aug 2011 02:39:25 +0000 (22:39 -0400)]
http: delete error kludge

The kludge is targeted at broken web browsers
like Chrome and IE, but it gets in the way of
sending 400 or 500-series error results with
formatted bodies in response to AJAX requests
made by pages executing in those browsers.

Now the AJAX cases will work and Chrome
and IE will be as broken with Go servers as
they are with all the other servers.

Fixes #2169.

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

13 years agobuild: avoid redundant bss declarations
Russ Cox [Wed, 24 Aug 2011 02:39:14 +0000 (22:39 -0400)]
build: avoid redundant bss declarations

Some compilers care, sadly.

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

13 years agonet: add ParseMAC function
Paul Borman [Wed, 24 Aug 2011 02:38:43 +0000 (22:38 -0400)]
net: add ParseMAC function

ParseMAC parses a string representing MAC-48, EUI-48, or EUI-64 into
a HardwareAddr.

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

13 years agomisc/dashboard: remove limit for json package list
Andrew Gerrand [Tue, 23 Aug 2011 23:52:03 +0000 (09:52 +1000)]
misc/dashboard: remove limit for json package list

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

13 years agogo/ast cleanup: base File/PackageExports on FilterFile/FilterPackage code
Robert Griesemer [Tue, 23 Aug 2011 23:03:42 +0000 (16:03 -0700)]
go/ast cleanup: base File/PackageExports on FilterFile/FilterPackage code

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

13 years agogo/ast: adjustments to filter function
Robert Griesemer [Tue, 23 Aug 2011 21:17:18 +0000 (14:17 -0700)]
go/ast: adjustments to filter function

CL 4938041 made some incorrect changes to the filter
function which caused a different doc/codelab/wiki/index.html
file to be generated.

Added FilterFileExports and FilterPackageExports function.
Same as the existing FileExpors/PackageExports functions
but using shared code. The old functions will be removed
in the next CL.

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

13 years agogc: fix pc/line table
Julian Phillips [Tue, 23 Aug 2011 21:01:14 +0000 (17:01 -0400)]
gc: fix pc/line table

When a line directive was encountered we would push a new 'z' entry into
the history to indicate the start of new file attributation, and a 'Z'
entry to change line numbering.  However we didn't pop the 'z' entry, so
we were actually corrupting the history stack.  The most obvious
occurance of this was in the code that build the symbol tables for the
DWARF information - where an internal stack in the linker would overflow
when more than a few line directives were encountered in a single stack
(Issue 1878).  So now we pop the 'z' entry when we encounter the end of
the file that the directive was in, which maintains the history stack
integrity.

Also, although new 'z' entries for new files had relative paths
expanded, the same was not done for line directives.  Now we do it for
line directives also - so that the now correct DWARF information has the
full path available.

Fixes #1878.

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

13 years agoruntime: fix void warnings
Russ Cox [Tue, 23 Aug 2011 17:13:27 +0000 (13:13 -0400)]
runtime: fix void warnings

Add -V flag to 6c command line to keep them fixed.

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

13 years agogo/parser: fix type switch scoping
Robert Griesemer [Tue, 23 Aug 2011 16:22:41 +0000 (09:22 -0700)]
go/parser: fix type switch scoping

Introduce extra scope for the variable declared by a
TypeSwitchGuard so that it doesn't conflict with vars
declared by the initial SimpleStmt of a type switch.

This is a replacement for CL 4896053 which caused
a build breakage.

Also:
- explicitly detect type switches (as opposed to detecting
  expression switches and then do extra testing for type switches)
- fix all outstanding TODOs in parser.go
- ran all tests

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

13 years agohttp: add MaxBytesReader to limit request body size
Brad Fitzpatrick [Tue, 23 Aug 2011 08:17:21 +0000 (12:17 +0400)]
http: add MaxBytesReader to limit request body size

This adds http.MaxBytesReader, similar to io.LimitReader,
but specific to http, and for preventing a class of DoS
attacks.

This also makes the 10MB ParseForm limit optional (if
not already set by a MaxBytesReader), documents it,
and also adds "PUT" as a valid verb for parsing forms
in the request body.

Improves issue 2093 (DoS protection)
Fixes #2165 (PUT form parsing)

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

13 years agoeffective go: fix erroneous quoting of ampersands that cropped up
Rob Pike [Tue, 23 Aug 2011 03:54:29 +0000 (13:54 +1000)]
effective go: fix erroneous quoting of ampersands that cropped up

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

13 years agoruntime: simplify stack traces
Russ Cox [Tue, 23 Aug 2011 03:26:39 +0000 (23:26 -0400)]
runtime: simplify stack traces

Make the stack traces more readable for new
Go programmers while preserving their utility for old hands.

- Change status number [4] to string.
- Elide frames in runtime package (internal details).
- Swap file:line and arguments.
- Drop 'created by' for main goroutine.
- Show goroutines in order of allocation:
  implies main goroutine first if nothing else.

There is no option to get the extra frames back.
Uncomment 'return 1' at the bottom of symtab.c.

$ 6.out
throw: all goroutines are asleep - deadlock!

goroutine 1 [chan send]:
main.main()
       /Users/rsc/g/go/src/pkg/runtime/x.go:22 +0x8a

goroutine 2 [select (no cases)]:
main.sel()
       /Users/rsc/g/go/src/pkg/runtime/x.go:11 +0x18
created by main.main
       /Users/rsc/g/go/src/pkg/runtime/x.go:19 +0x23

goroutine 3 [chan receive]:
main.recv(0xf8400010a0, 0x0)
       /Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
created by main.main
       /Users/rsc/g/go/src/pkg/runtime/x.go:20 +0x50

goroutine 4 [chan receive (nil chan)]:
main.recv(0x0, 0x0)
       /Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
created by main.main
       /Users/rsc/g/go/src/pkg/runtime/x.go:21 +0x66
$

$ 6.out index
panic: runtime error: index out of range

goroutine 1 [running]:
main.main()
        /Users/rsc/g/go/src/pkg/runtime/x.go:25 +0xb9
$

$ 6.out nil
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x22ca]

goroutine 1 [running]:
main.main()
        /Users/rsc/g/go/src/pkg/runtime/x.go:28 +0x211
$

$ 6.out panic
panic: panic

goroutine 1 [running]:
main.main()
        /Users/rsc/g/go/src/pkg/runtime/x.go:30 +0x101
$

R=golang-dev, qyzhai, n13m3y3r, r
CC=golang-dev
https://golang.org/cl/4907048

13 years agold: handle Plan 9 ar format
Lucio De Re [Tue, 23 Aug 2011 03:24:38 +0000 (23:24 -0400)]
ld: handle Plan 9 ar format

The Go version has 64 character long section names; originally,
in Plan 9, the limit was 16.  To provide compatibility, this
change allows the input length to be either the target length
or the earlier option. The section name is extended with spaces
where required.

This has been tested to work without regressions in the
Go environment, testing the older alternative has not been
possible yet.

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

13 years agosyscall: openbsd amd64 syscall support
Joel Sing [Tue, 23 Aug 2011 03:24:32 +0000 (23:24 -0400)]
syscall: openbsd amd64 syscall support

Add support for syscalls on openbsd amd64. This is based on the
existing freebsd amd64 implementation.

R=mikioh.mikioh, rsc, yourcomputerpal
CC=golang-dev
https://golang.org/cl/4798060

13 years agobuild: add openbsd
Joel Sing [Tue, 23 Aug 2011 03:24:25 +0000 (23:24 -0400)]
build: add openbsd

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

13 years agoos: disable Hostname test on OpenBSD
Joel Sing [Tue, 23 Aug 2011 03:24:16 +0000 (23:24 -0400)]
os: disable Hostname test on OpenBSD

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

13 years agold: remove duplicate bss definitions
Russ Cox [Tue, 23 Aug 2011 03:23:57 +0000 (23:23 -0400)]
ld: remove duplicate bss definitions

The EXTERN lines in elf.h already define these.
That's not a problem for most C compilers, but
apparently it is for some copies of the OS X linker.

Fixes #2167.

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

13 years agoexp/template/html: differentiate URL-valued attributes (such as href)
Nigel Tao [Tue, 23 Aug 2011 03:22:26 +0000 (13:22 +1000)]
exp/template/html: differentiate URL-valued attributes (such as href)
from others (such as title) during escaping.

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

13 years agogo/ast: generalize ast.FilterFile
Robert Griesemer [Tue, 23 Aug 2011 01:51:51 +0000 (18:51 -0700)]
go/ast: generalize ast.FilterFile

ast.FilterFile(src, ast.IsExported) has the same
effect as ast.FileExports(src) with this change.

1st step towards removing FileExports - it is
just a special case of FilterFile with this CL.

Added corresponding test.

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

13 years agogodoc: add dummy playground.js to silence godoc warning at start-up
Robert Griesemer [Mon, 22 Aug 2011 21:06:07 +0000 (14:06 -0700)]
godoc: add dummy playground.js to silence godoc warning at start-up

Fixes #2173.

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

13 years agogo/ast: fix ast.MergePackageFiles to collect infos about imports
Sebastien Binet [Mon, 22 Aug 2011 19:53:05 +0000 (12:53 -0700)]
go/ast: fix ast.MergePackageFiles to collect infos about imports

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

13 years agoruntime: Remove extraneous word in comment.
Ian Lance Taylor [Mon, 22 Aug 2011 19:40:45 +0000 (12:40 -0700)]
runtime: Remove extraneous word in comment.

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

13 years agoeffective go: extract and test a couple more examples.
Rob Pike [Mon, 22 Aug 2011 12:46:59 +0000 (22:46 +1000)]
effective go: extract and test a couple more examples.

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

13 years agogob: explain that Debug isn't useful unless it's compiled in.
Rob Pike [Mon, 22 Aug 2011 12:43:49 +0000 (22:43 +1000)]
gob: explain that Debug isn't useful unless it's compiled in.

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

13 years agoexp/norm: added implemenation for []byte versions of methods.
Marcel van Lohuizen [Mon, 22 Aug 2011 10:52:04 +0000 (12:52 +0200)]
exp/norm: added implemenation for []byte versions of methods.

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

13 years agoexp/norm: a few minor fixes to support the implementation of norm.
Marcel van Lohuizen [Mon, 22 Aug 2011 10:11:29 +0000 (12:11 +0200)]
exp/norm: a few minor fixes to support the implementation of norm.
maketables.go/tables.go
- Properly set combinesForward flag for JamoL and JamoV.
- Fixed Printf bug.
composition.go
- Make insertString use the same control flow as insert.
- Better Hangul and non-Hangul mixing.
forminfo.go
- Fixed bug in compBoundaryBefore that affected a few esoteric cases.
- Buffer overflow now tested in normalize_test.go (other CL).

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

13 years agotemplate/parse: give if, range, and with a common representation.
Rob Pike [Mon, 22 Aug 2011 07:09:00 +0000 (17:09 +1000)]
template/parse: give if, range, and with a common representation.
No external changes.

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

13 years agogofix: osopen: fixed=true when changing O_CREAT
Tarmigan Casebolt [Mon, 22 Aug 2011 05:40:15 +0000 (15:40 +1000)]
gofix: osopen: fixed=true when changing O_CREAT

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

13 years ago json: calculate Offset for Indent correctly
Jeff Hodges [Mon, 22 Aug 2011 05:19:27 +0000 (15:19 +1000)]
json: calculate Offset for Indent correctly

Fixes #2171

This is the real change.

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

13 years agotemplate/parse: remove Walk.
Rob Pike [Mon, 22 Aug 2011 04:19:37 +0000 (14:19 +1000)]
template/parse: remove Walk.
It was ill-conceived and can be resurrected if needed.

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

13 years agocmd/gc/lex: remove reference to container/vector in comment
Rob Pike [Mon, 22 Aug 2011 04:07:27 +0000 (14:07 +1000)]
cmd/gc/lex: remove reference to container/vector in comment

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

13 years agocmd/hgpatch: remove container/vector
Rob Pike [Mon, 22 Aug 2011 04:02:36 +0000 (14:02 +1000)]
cmd/hgpatch: remove container/vector

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

13 years agocontainer/heap/heap_test.go: remove container/vector
Rob Pike [Mon, 22 Aug 2011 03:55:22 +0000 (13:55 +1000)]
container/heap/heap_test.go: remove container/vector

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

13 years agotest/chan/sieve2.go: remove container/vector.
Rob Pike [Mon, 22 Aug 2011 03:29:17 +0000 (13:29 +1000)]
test/chan/sieve2.go: remove container/vector.

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

13 years agoreflect: remove references to container/vector.
Rob Pike [Mon, 22 Aug 2011 03:22:42 +0000 (13:22 +1000)]
reflect: remove references to container/vector.
It's not even using vectors - the references are just examples.

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

13 years agobuild: build more packages/commands for Plan 9
Fazlul Shahriar [Mon, 22 Aug 2011 01:03:17 +0000 (11:03 +1000)]
build: build more packages/commands for Plan 9

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

13 years agoeffective_go: fix brace quotes.
Rob Pike [Sun, 21 Aug 2011 22:18:03 +0000 (08:18 +1000)]
effective_go: fix brace quotes.

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

13 years agogotry: add missing $
Tarmigan Casebolt [Sun, 21 Aug 2011 20:17:02 +0000 (13:17 -0700)]
gotry: add missing $

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

13 years agogoinstall: error out with paths that end with '/'
Tarmigan Casebolt [Sun, 21 Aug 2011 10:28:29 +0000 (20:28 +1000)]
goinstall: error out with paths that end with '/'

R=adg, rsc, tarmigan+golang
CC=golang-dev
https://golang.org/cl/4807048

13 years agoeffective_go: convert to use tmpltohtml.
Rob Pike [Sat, 20 Aug 2011 23:46:19 +0000 (09:46 +1000)]
effective_go: convert to use tmpltohtml.
Also update the big example to the new template system.
There are a number of other examples that should be
extracted; this CL serves as an introduction to the
approach.

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

13 years agodoc/tmpltohtml: update to new template package.
Rob Pike [Sat, 20 Aug 2011 23:04:21 +0000 (09:04 +1000)]
doc/tmpltohtml: update to new template package.
Trivial change: just fix the import.

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

13 years agogodoc: minor fixes
Robert Griesemer [Sat, 20 Aug 2011 19:39:38 +0000 (12:39 -0700)]
godoc: minor fixes

- templates should be read before any handlers are started
- for app engine use, must use underlying file system to read templates

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

13 years agogodoc: remove uses of container/vector
Robert Griesemer [Sat, 20 Aug 2011 19:30:26 +0000 (12:30 -0700)]
godoc: remove uses of container/vector

In the process, rewrite index.go to use slices instead
of vectors, rewrite for-loops into range loops, and
generally simplify code (this code was written before
the launch of go and showed its age).

Also, fix a wrong import in appinit.go.

No significant performance changes (improvements);
most of time is spent elsewhere (measured on an stand-
alone MacBook Pro with SSD disk, running standard
godoc settings: godoc -v -http=:7777 -index).

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

13 years agotype switches: test for pathological case
Robert Griesemer [Fri, 19 Aug 2011 16:31:50 +0000 (09:31 -0700)]
type switches: test for pathological case

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

13 years agotemplate/parse: add a Walk method to Tree.
Rob Pike [Fri, 19 Aug 2011 04:19:56 +0000 (14:19 +1000)]
template/parse: add a Walk method to Tree.

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

13 years agonet: fix windows build
Alex Brainman [Fri, 19 Aug 2011 03:00:09 +0000 (13:00 +1000)]
net: fix windows build

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

13 years agomime: ParseMediaType returns os.Error now, not a nil map
Brad Fitzpatrick [Thu, 18 Aug 2011 19:51:23 +0000 (12:51 -0700)]
mime: ParseMediaType returns os.Error now, not a nil map

ParseMediaType previously documented that it always returned
a non-nil map, but also documented that it returned a nil map
to signal an error.

That is confusing, contradictory and not Go-like.

Now it returns (mediatype string, params map, os.Error).

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

13 years agoundo CL 4896053 / c62cf48b7dc4: fix build
Robert Griesemer [Thu, 18 Aug 2011 18:42:19 +0000 (11:42 -0700)]
undo CL 4896053 / c62cf48b7dc4: fix build

The subtle AST changes introduced with CL 4896053
broke type checking of type switches in gofix.
Coming up with a correct fix will take some time.
Undoing this change for now.

««« original CL description
go/parser: fix type switch scoping

The variable declared by a TypeSwitchGuard must be
visible in each TypeCaseClause and must not conflict
with other variables declared by the initial SimpleStmt
of a type switch.

Also:
- explicitly detect type switches (as opposed to detecting
  regular (expression switches) and then do extra testing
  for type switches
- fix all outstanding TODOs in parser.go

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

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

13 years agogo/parser: fix type switch scoping
Robert Griesemer [Thu, 18 Aug 2011 17:28:58 +0000 (10:28 -0700)]
go/parser: fix type switch scoping

The variable declared by a TypeSwitchGuard must be
visible in each TypeCaseClause and must not conflict
with other variables declared by the initial SimpleStmt
of a type switch.

Also:
- explicitly detect type switches (as opposed to detecting
  regular (expression switches) and then do extra testing
  for type switches
- fix all outstanding TODOs in parser.go

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

13 years agoruntime: ctrlhandler for windows amd64
Wei Guangjing [Thu, 18 Aug 2011 16:37:42 +0000 (12:37 -0400)]
runtime: ctrlhandler for windows amd64

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

13 years agonet: join and leave a IPv6 group address, on a specific interface
Mikio Hara [Thu, 18 Aug 2011 16:22:02 +0000 (12:22 -0400)]
net: join and leave a IPv6 group address, on a specific interface

This CL changes both JoinGroup and LeaveGroup methods
to take an interface as an argument for enabling IPv6
group address join/leave, join a group address on a
specific interface.

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

13 years agoruntime: speed up cgo calls
Alex Brainman [Thu, 18 Aug 2011 16:17:09 +0000 (12:17 -0400)]
runtime: speed up cgo calls

Allocate Defer on stack during cgo calls, as suggested
by dvyukov. Also includes some comment corrections.

benchmark                   old,ns/op   new,ns/op
BenchmarkCgoCall                  669         330
(Intel Xeon CPU 1.80GHz * 4, Linux 386)

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

13 years agoexp/template: remove else and end nodes from public view.
Rob Pike [Thu, 18 Aug 2011 06:07:28 +0000 (16:07 +1000)]
exp/template: remove else and end nodes from public view.
They are used internally and do not appear in the final parse tree.

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

13 years agotag weekly.2011-10-17
Andrew Gerrand [Thu, 18 Aug 2011 04:34:00 +0000 (14:34 +1000)]
tag weekly.2011-10-17

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

13 years agoweekly.2011-08-17 weekly.2011-08-17
Andrew Gerrand [Thu, 18 Aug 2011 04:27:08 +0000 (14:27 +1000)]
weekly.2011-08-17

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

13 years agogofix: walk names in ValueSpecs
Rob Pike [Thu, 18 Aug 2011 03:48:44 +0000 (13:48 +1000)]
gofix: walk names in ValueSpecs

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

13 years agotest/chan/select5.go: change "with" to "if" in templatea
Rob Pike [Thu, 18 Aug 2011 03:27:18 +0000 (13:27 +1000)]
test/chan/select5.go: change "with" to "if" in templatea

I converted this program yesterday and the output is the
same as it used to be, ignoring space, but the result is
not the best expression of the algorithm.  The old {.section
Maybe} pieces are now {{with .Maybe}}, as a direct translation,
but I they should be {{if .Maybe}} as the output is just a
bool and there is no cascading.

I have verified that the output of the program is unaffected.

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

13 years agomisc/vim: command complete using autoload helper function.
Yasuhiro Matsumoto [Thu, 18 Aug 2011 01:50:55 +0000 (11:50 +1000)]
misc/vim: command complete using autoload helper function.

R=golang-dev, dsymonds, jnwhiteh, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/4837051

13 years agohttp: remove a TODO due to new behavior of nil maps
Rob Pike [Thu, 18 Aug 2011 01:01:43 +0000 (11:01 +1000)]
http: remove a TODO due to new behavior of nil maps

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

13 years agoexp/template/html: defines a parse context for a subset of HTML.
Mike Samuel [Thu, 18 Aug 2011 00:40:29 +0000 (10:40 +1000)]
exp/template/html: defines a parse context for a subset of HTML.

This defines just enough context to distinguish HTML URI attributes
from parsed character data.

It does not affect any public module API as I thought I would get
early comment on style for defining enumerations and tables.

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

13 years agodoc/codelab: use new template package
Andrew Gerrand [Thu, 18 Aug 2011 00:38:08 +0000 (10:38 +1000)]
doc/codelab: use new template package

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

13 years agogodoc: template cleanup
Robert Griesemer [Wed, 17 Aug 2011 23:38:58 +0000 (16:38 -0700)]
godoc: template cleanup

Use naming convention for template variables
to indicate "escaped-ness" for easier reviewing.
(per suggestion from bradfitz)

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

13 years agotest: new nil semantics
Russ Cox [Wed, 17 Aug 2011 19:55:06 +0000 (15:55 -0400)]
test: new nil semantics

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

13 years agogc: implement nil chan support
Russ Cox [Wed, 17 Aug 2011 19:54:17 +0000 (15:54 -0400)]
gc: implement nil chan support

The spec has defined nil chans this way for months.
I'm behind.

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

13 years agogc: implement nil map support
Russ Cox [Wed, 17 Aug 2011 18:56:27 +0000 (14:56 -0400)]
gc: implement nil map support

The spec has defined nil maps this way for months.
I'm behind.

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

13 years agogc: fix mkbuiltin
Russ Cox [Wed, 17 Aug 2011 18:54:51 +0000 (14:54 -0400)]
gc: fix mkbuiltin

Broken by Plan 9 changes.

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

13 years agogo/parser: disallow for statements w/ illegal range clauses
Robert Griesemer [Wed, 17 Aug 2011 17:45:30 +0000 (10:45 -0700)]
go/parser: disallow for statements w/ illegal range clauses

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

13 years agonet: Plan 9 support
Fazlul Shahriar [Wed, 17 Aug 2011 17:28:29 +0000 (13:28 -0400)]
net: Plan 9 support

All tests enabled by default passes except those in timeout_test.go.

For TestLookupPort, add an entry for "bootps" in /lib/ndb/common
(Plan 9 calls it "bootp"). I've sent out a patch to fix this.

R=paulzhol, rsc, mikioh.mikioh
CC=ality, golang-dev
https://golang.org/cl/4779041

13 years agogo/parser: do not accept type literals where not permitted in general
Robert Griesemer [Wed, 17 Aug 2011 17:27:32 +0000 (10:27 -0700)]
go/parser: do not accept type literals where not permitted in general

- Resolves a long-standing TODO.
- Replacement for CL 4908042 by befelemepeseveze@gmail.com

Fixes #2155.

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

13 years agoxml: escape string chardata in xml.Marshal
Kyle Lemons [Wed, 17 Aug 2011 16:12:08 +0000 (12:12 -0400)]
xml: escape string chardata in xml.Marshal

Fixes #2150.

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

13 years agoasn1: add support for unmarshalling structs with int32 members
Dave Cheney [Wed, 17 Aug 2011 16:12:01 +0000 (12:12 -0400)]
asn1: add support for unmarshalling structs with int32 members

Also improve error message for unsupported integer types

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

13 years agoexp/norm: implementation of decomposition and composing functionality.
Marcel van Lohuizen [Wed, 17 Aug 2011 08:12:39 +0000 (18:12 +1000)]
exp/norm: implementation of decomposition and composing functionality.
forminfo.go:
- Wrappers for table data.
- Per Form dispatch table.
composition.go:
- reorderBuffer type.  Implements decomposition, reordering, and composition.
- Note: decompose and decomposeString fields in formInfo could be replaced by
  a pointer to the trie for the respective form.  The proposed design makes
  testing easier, though.
normalization.go:
- Temporarily added panic("not implemented") methods to make the tests run.
  These will be removed again with the next CL, which will introduce the
  implementation.

R=r, rogpeppe, mpvl, rsc
CC=golang-dev
https://golang.org/cl/4875043

13 years agotest/chan/select5.go: update to new templates
Rob Pike [Wed, 17 Aug 2011 06:51:04 +0000 (16:51 +1000)]
test/chan/select5.go: update to new templates

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

13 years agoexp/template/html: rework Reverse(*Template) to do naive autoescaping
Mike Samuel [Wed, 17 Aug 2011 06:00:02 +0000 (16:00 +1000)]
exp/template/html: rework Reverse(*Template) to do naive autoescaping

Replaces the toy func Reverse(*Template) with one that implements
naive autoescaping.

Now Escape(*Template) walks a template parse tree to find all
template actions and adds the |html command to them if it is not
already present.

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

13 years agodoc/codewalk: new Markov chain codewalk
Andrew Gerrand [Wed, 17 Aug 2011 05:53:17 +0000 (15:53 +1000)]
doc/codewalk: new Markov chain codewalk

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

13 years agotemplate: move exp/template into template.
Rob Pike [Wed, 17 Aug 2011 04:55:57 +0000 (14:55 +1000)]
template: move exp/template into template.
(Leave exp/template/html where it is for now.)

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

13 years agotemplate: delete old template code.
Rob Pike [Wed, 17 Aug 2011 04:34:48 +0000 (14:34 +1000)]
template: delete old template code.
It's already in old/template; make that build.
Update a couple of references to point to the old template.
They can be updated later.
Update goplay to use exp/template.

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

13 years agomisc: fix a couple of template uses preparatory to the big switch.
Rob Pike [Wed, 17 Aug 2011 03:57:06 +0000 (13:57 +1000)]
misc: fix a couple of template uses preparatory to the big switch.

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

13 years agourl: new package
Rob Pike [Wed, 17 Aug 2011 03:36:02 +0000 (13:36 +1000)]
url: new package
This is just moving the URL code from package http into its own package,
which has been planned for a while.
Besides clarity, this also breaks a nascent dependency cycle the new template
package was about to introduce.

Add a gofix module, url, and use it to generate changes outside http and url.

Sadness about the churn, gladness about some of the naming improvements.

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

13 years agonet: Added function SetTimeout() to interface Listener.
Aleksandar Dezelin [Tue, 16 Aug 2011 22:36:51 +0000 (18:36 -0400)]
net: Added function SetTimeout() to interface Listener.
Fixes #2148.

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

13 years agogo/parser: use correct precedence when parsing range clauses
Robert Griesemer [Tue, 16 Aug 2011 22:19:23 +0000 (15:19 -0700)]
go/parser: use correct precedence when parsing range clauses

Fixes #2156.

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

13 years agoA+C: Aleksandar Dezelin (individual CLA)
Russ Cox [Tue, 16 Aug 2011 22:15:36 +0000 (18:15 -0400)]
A+C: Aleksandar Dezelin (individual CLA)

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

13 years agonet: add multicast stubs for openbsd
Joel Sing [Tue, 16 Aug 2011 21:28:16 +0000 (17:28 -0400)]
net: add multicast stubs for openbsd

Add multicast stubs and sync with recent changes.

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

13 years agonet, syscall: move multicast address handling
Joel Sing [Tue, 16 Aug 2011 21:26:51 +0000 (17:26 -0400)]
net, syscall: move multicast address handling

Multicast address handling is not consistent across all BSDs. Move
the multicast address handling code into OS dependent files. This
will be needed for OpenBSD support.

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

13 years agonet: return correct local address for an accepted TCP connection
Mikio Hara [Tue, 16 Aug 2011 20:53:09 +0000 (16:53 -0400)]
net: return correct local address for an accepted TCP connection

Fixes #2127.

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

13 years agoruntime: fix GC bitmap corruption
Dmitriy Vyukov [Tue, 16 Aug 2011 20:53:02 +0000 (16:53 -0400)]
runtime: fix GC bitmap corruption
The corruption can occur when GOMAXPROCS
is changed from >1 to 1, since GOMAXPROCS=1
does not imply there is only 1 goroutine running,
other goroutines can still be not parked after
the change.

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

13 years agocgo: omit duplicate symbols in writeDefs
Julian Phillips [Tue, 16 Aug 2011 18:56:23 +0000 (14:56 -0400)]
cgo: omit duplicate symbols in writeDefs

When the C API being used includes multiple names for the same
underlying symbol (e.g. multiple #define's for the same variable), then
cgo will generate the same placeholder variables for each name.  This
then prevents the code from compiling due to multiple declarations of
the same variable - so change cgo to only create one instance of the
variable for the underlying symbol.

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

13 years ago5l, 6l, 8l: add varargck for %Z
Lucio De Re [Tue, 16 Aug 2011 18:22:12 +0000 (14:22 -0400)]
5l, 6l, 8l: add varargck for %Z

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

13 years ago5c, 6c, 6l: fix Plan 9 build warnings
Lucio De Re [Tue, 16 Aug 2011 18:22:08 +0000 (14:22 -0400)]
5c, 6c, 6l: fix Plan 9 build warnings

src/cmd/5c/reg.c:
. Added USED() attribute.

src/cmd/6c/cgen.c:
. Revised code around "REGARG" to resemble use in "8c" and
  consequently remove a warning.

src/cmd/6l/asm.c:
. Added USED() attributes.
. Removed an unnecessary assignment.

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

13 years agold: make addaddrplus4 static
Lucio De Re [Tue, 16 Aug 2011 18:22:02 +0000 (14:22 -0400)]
ld: make addaddrplus4 static

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

13 years agoerrchk: allow multiple patterns
Russ Cox [Tue, 16 Aug 2011 15:14:26 +0000 (11:14 -0400)]
errchk: allow multiple patterns

// ERROR "pattern1" "pattern2"

means that there has to be one or more
lines matching pattern1 and then excluding
those, there have to be one or more lines
matching pattern2.  So if you expect two
different error messages from a particular
line, writing two separate patterns checks
that both errors are produced.

Also, errchk now flags lines that produce
more errors than expected.  Before, as long as
at least one error matched the pattern, all the
others were ignored.

Revise tests to expect or silence these
additional errors.

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