]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agonet: make use of IPv4len, IPv6len
Mikio Hara [Thu, 25 Aug 2011 23:00:04 +0000 (19:00 -0400)]
net: make use of IPv4len, IPv6len

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

13 years agogoinstall: report lack of $GOPATH on errors
Gustavo Niemeyer [Thu, 25 Aug 2011 22:12:03 +0000 (19:12 -0300)]
goinstall: report lack of $GOPATH on errors

Fixes #2175.

R=alex.brainman, rsc, gustavo, adg
CC=golang-dev
https://golang.org/cl/4929047

13 years agostrconv: put decimal on stack
Russ Cox [Thu, 25 Aug 2011 21:54:14 +0000 (17:54 -0400)]
strconv: put decimal on stack

This makes decimal a good test
case for the escape analysis.

With escape analysis:

benchmark                 old ns/op    new ns/op    delta
BenchmarkAtof64Decimal         1954          243  -87.56%
BenchmarkAtof64Float           2008          293  -85.41%
BenchmarkAtof64FloatExp       10106         8814  -12.78%
BenchmarkAtof64Big             5113         3486  -31.82%

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

13 years agodoc: emphasize that environment variables are optional
Russ Cox [Thu, 25 Aug 2011 20:53:54 +0000 (16:53 -0400)]
doc: emphasize that environment variables are optional

Also update $GOARM description.

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

13 years agobuild: fix more unused parameters
Russ Cox [Thu, 25 Aug 2011 20:29:56 +0000 (16:29 -0400)]
build: fix more unused parameters

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

13 years agogc: shuffle #includes
Russ Cox [Thu, 25 Aug 2011 20:25:10 +0000 (16:25 -0400)]
gc: shuffle #includes

#include "go.h" (or "gg.h")

becomes

#include <u.h>
#include <libc.h>
#include "go.h"

so that go.y can #include <stdio.h>
after <u.h> but before "go.h".
This is necessary on Plan 9.

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

13 years agobuild: fix unused parameters
Russ Cox [Thu, 25 Aug 2011 20:08:13 +0000 (16:08 -0400)]
build: fix unused parameters

Found with gcc 4.6 -Wunused -Wextra
but should be applicable to Plan 9 too.

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

13 years agotemplate: Grammar fix for template documentation.
Bill Neubauer [Thu, 25 Aug 2011 16:25:19 +0000 (12:25 -0400)]
template: Grammar fix for template documentation.

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

13 years agogc: fix some spurious leaks
Russ Cox [Thu, 25 Aug 2011 13:26:13 +0000 (09:26 -0400)]
gc: fix some spurious leaks

Probably will spark some discussion.  ☺

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

13 years agohttp: return 413 instead of 400 when the request body is too large
Dave Cheney [Thu, 25 Aug 2011 10:00:00 +0000 (14:00 +0400)]
http: return 413 instead of 400 when the request body is too large

RFC2616 says servers should return this status code when
rejecting requests that are too large.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14

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

13 years agoexp/template/html: add some tests for ">" attributes.
Nigel Tao [Thu, 25 Aug 2011 03:48:21 +0000 (13:48 +1000)]
exp/template/html: add some tests for ">" attributes.

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

13 years agoexp/template/html: Reworked escapeText to recognize attr boundaries.
Mike Samuel [Thu, 25 Aug 2011 01:24:43 +0000 (11:24 +1000)]
exp/template/html: Reworked escapeText to recognize attr boundaries.

The following testcases now pass:

`<a href=x` tests that we do not error on partial unquoted attrs.
`<a href=x ` tests that spaces do end unquoted attrs on spaces.
`<a href=''` tests that we recognize the end of single quoted attrs.
`<a href=""` tests that we recognize the end of double quoted attrs.

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

13 years agoversion.bash: update VERSION on -save if already present
Gustavo Niemeyer [Thu, 25 Aug 2011 01:10:25 +0000 (22:10 -0300)]
version.bash: update VERSION on -save if already present

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

13 years agogofix: forgot to rename the URL type
Rob Pike [Thu, 25 Aug 2011 00:16:11 +0000 (10:16 +1000)]
gofix: forgot to rename the URL type
Fixes #2182

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

13 years agobufio: handle a "\r\n" that straddles the buffer.
Andrew Gerrand [Wed, 24 Aug 2011 22:44:12 +0000 (08:44 +1000)]
bufio: handle a "\r\n" that straddles the buffer.

Fixes #2164.

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

13 years agobig: fix nat.scan bug
Evan Shaw [Wed, 24 Aug 2011 21:55:03 +0000 (14:55 -0700)]
big: fix nat.scan bug

Scanning "0" with detected base did not actually set the nat to 0.

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

13 years agogc: simplify escape analysis recursion
Russ Cox [Wed, 24 Aug 2011 20:47:32 +0000 (16:47 -0400)]
gc: simplify escape analysis recursion

Merge escassign(N, x), escassign(x, N), escexpr(n), and escstmt(n) into esc(n).

1. Renaming
https://golang.org/cl/4917050/diff2/1:2001/src/cmd/gc/esc.c

2. Merging.
https://golang.org/cl/4917050/diff2/2001:4001/src/cmd/gc/esc.c

3. Simplify esccall.
https://golang.org/cl/4917050/diff2/4001:5002/src/cmd/gc/esc.c

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

13 years agomisc/emacs: refine label detection
Russ Cox [Wed, 24 Aug 2011 20:47:12 +0000 (16:47 -0400)]
misc/emacs: refine label detection

Based on idea in
http://patch-tracker.debian.org/patch/series/view/golang/1:59-1/008-emacs-mode-key-literal-indent.patch

Fixes #2174.

R=amdragon, ajmani, amdragon
CC=golang-dev
https://golang.org/cl/4922049

13 years agomath: fix Pow10 loop
Volker Dobler [Wed, 24 Aug 2011 17:59:52 +0000 (13:59 -0400)]
math: fix Pow10 loop

Pow10 failed for MinInt32 (endless loop until out of
memory).  Fix by returning 0 and +Inf for all arguments
where the result is not representable in a float64.
Fixes #2159.

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

13 years agonet: make use of IPv4len, IPv6len
Mikio Hara [Wed, 24 Aug 2011 17:59:33 +0000 (13:59 -0400)]
net: make use of IPv4len, IPv6len

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

13 years agocov: remove tautological #defines
Lucio De Re [Wed, 24 Aug 2011 17:59:17 +0000 (13:59 -0400)]
cov: remove tautological #defines

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

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