]> Cypherpunks repositories - gostls13.git/log
gostls13.git
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

13 years agorpc: make Server.Mutex unexported
Dmitriy Vyukov [Tue, 16 Aug 2011 08:34:56 +0000 (18:34 +1000)]
rpc: make Server.Mutex unexported
Currently it's possible to write:
var s rpc.Server
...
// reuse for my own purposes
s.Lock()
...
s.Unlock()
which is seemingly not intended.

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

13 years agosyscall: make LazyDLL/LazyProc.Mutex unexported
Dmitriy Vyukov [Tue, 16 Aug 2011 08:33:48 +0000 (18:33 +1000)]
syscall: make LazyDLL/LazyProc.Mutex unexported
They are seemingly not intended to be a part
of the public interface.

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

13 years agobuiltin: correct description of a closed channel.
Rob Pike [Tue, 16 Aug 2011 06:03:30 +0000 (16:03 +1000)]
builtin: correct description of a closed channel.

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

13 years agobuiltin: tweak a couple of descriptions.
Rob Pike [Tue, 16 Aug 2011 05:24:00 +0000 (15:24 +1000)]
builtin: tweak a couple of descriptions.

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

13 years agogodoc: show all top-level decls for (fake) package builtin
Robert Griesemer [Tue, 16 Aug 2011 02:05:52 +0000 (19:05 -0700)]
godoc: show all top-level decls for (fake) package builtin

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

13 years agogodoc: fix lib/godoc/package.txt template
Robert Griesemer [Mon, 15 Aug 2011 22:42:27 +0000 (15:42 -0700)]
godoc: fix lib/godoc/package.txt template

- show documentation in text mode; e.g.:
http://localhost:7777/cmd/godoc/?f=text

- simplify template by using $ variable

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

13 years agogodoc: fix escaping in templates
Robert Griesemer [Mon, 15 Aug 2011 22:15:54 +0000 (15:15 -0700)]
godoc: fix escaping in templates

- HTML-escape URL paths
- URL-escape URL parameters

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

13 years agorpc: implement ServeRequest to synchronously serve a single request.
Sugu Sougoumarane [Mon, 15 Aug 2011 22:06:22 +0000 (08:06 +1000)]
rpc: implement ServeRequest to synchronously serve a single request.

This is useful for applications that want to micromanage the rpc service.
Moved part of ServeCodec into a new readRequest function.
Renamed existing readRequest to readRequestHeader, and reordered
its parameters to align with the new readRequest and service.call.

R=golang-dev, r, rsc, sougou
CC=golang-dev, msolomon
https://golang.org/cl/4889043

13 years agobuiltin: add documentation for builtins
Rob Pike [Mon, 15 Aug 2011 21:51:44 +0000 (07:51 +1000)]
builtin: add documentation for builtins
Do this by adding a fake package called builtin. At the moment, godoc will
not present this documentation because the function names are all lower case,
but there are plans to address this.
The print and println functions are undocumented here. I could be talked
into doing them but I'd rather not promote their use.

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

13 years agobuild: don't print anything on version.bash -save
Gustavo Niemeyer [Mon, 15 Aug 2011 17:25:54 +0000 (14:25 -0300)]
build: don't print anything on version.bash -save

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

13 years agobuild: support versioning without hg
Gustavo Niemeyer [Mon, 15 Aug 2011 17:19:30 +0000 (14:19 -0300)]
build: support versioning without hg

CL 4873048 introduced the ability to build without hg and
getting an "unknown" version.  While this approach works
to avoid the hg dependency, it also means that every
exported tree that is built without hg or .hg will have not
only missing information, but will also be compatible to
one another.  Considering that it is a common practice to
remove the VCS data in distributions, I suggest we don't
take this approach to avoid its consequences.

This CL fixes the same problem in a different way: if a
VERSION file at the top of the tree exists, use it at
all times.  If it doesn't, fall back to using information
from hg necessarily, and fail if that's not possible.  The
error message when VERSION and hg are not available
instructs users to handle it properly.

The VERSION file can be generated with
"src/version.bash -save" while hg is still around.

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

13 years agoreflect: panic on Invalid Interface call
Gustavo Niemeyer [Mon, 15 Aug 2011 17:14:15 +0000 (14:14 -0300)]
reflect: panic on Invalid Interface call

This was initially pushed as part of CL 4876046, found
when logic in exp/template was using the method on
an Invalid value.

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

13 years agobuild: don't require hg for build
Andrew Gerrand [Mon, 15 Aug 2011 11:19:07 +0000 (21:19 +1000)]
build: don't require hg for build

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

13 years agoruntime: fix pseudo-randomness on some selects
Gustavo Niemeyer [Mon, 15 Aug 2011 06:51:51 +0000 (03:51 -0300)]
runtime: fix pseudo-randomness on some selects

Fixes #2152.

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

13 years agoold/template: copy code from template
Rob Pike [Mon, 15 Aug 2011 05:16:57 +0000 (15:16 +1000)]
old/template: copy code from template
First step of moving exp/template into template: save the old code.
Code is unedited except for target name in Makefile.

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

13 years agoexp/template: support field syntax on maps
Gustavo Niemeyer [Mon, 15 Aug 2011 03:56:01 +0000 (00:56 -0300)]
exp/template: support field syntax on maps

While using exp/template in practice, the syntax for
indexing values using the "index" action was found to be
very inconvenient for frequent use when handling dynamic
data from maps such as the ones used with json and yaml,
that use a type like map[string]interface{}.

For these kinds of maps, the default handling of fields as
{{.Field}} makes the task of handling the several references
significantly more pleasant and elegant, and is equivalent
to what's currently done in the "template" package and in
other external packages (e.g. mustache).

Even with this change, the index action is still relevant
as it allows indexing maps in other scenarios where keys
wouldn't be valid field names.

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

13 years agoexp/template: don't panic on range of nil interface
Gustavo Niemeyer [Mon, 15 Aug 2011 03:22:28 +0000 (00:22 -0300)]
exp/template: don't panic on range of nil interface

This avoids a non-obvious panic when range is used on a
nil interface, and fixes it by behaving as if the range
was empty.

The new behavior is equivalent to the outcome of iterating
on a nil map or slice, and is useful because it allows
generic structures such as used in json (map[string]interface{})
to behave correctly if a key generally set to a list or map
isn't present.

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

13 years agoexp/norm: fix incorrect prints found by govet.
Robert Hencke [Sun, 14 Aug 2011 04:02:48 +0000 (14:02 +1000)]
exp/norm: fix incorrect prints found by govet.

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

13 years agogoinstall: report all newly-installed public packages
Andrew Gerrand [Sun, 14 Aug 2011 00:52:20 +0000 (10:52 +1000)]
goinstall: report all newly-installed public packages

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

13 years agoC: add Sugu Sougoumarane, Googler.
Rob Pike [Sat, 13 Aug 2011 23:35:01 +0000 (09:35 +1000)]
C: add Sugu Sougoumarane, Googler.

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

13 years agogodoc: fix godoc.html template bug: correctly display package roots
Andrew Gerrand [Sat, 13 Aug 2011 22:56:47 +0000 (08:56 +1000)]
godoc: fix godoc.html template bug: correctly display package roots

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

13 years agoexp/template: rename filter: url -> urlquery.
David Symonds [Sat, 13 Aug 2011 04:00:16 +0000 (14:00 +1000)]
exp/template: rename filter: url -> urlquery.

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

13 years agogodoc: position URLs (containing file names) must be quoted and URL escaped
Robert Griesemer [Fri, 12 Aug 2011 23:28:55 +0000 (16:28 -0700)]
godoc: position URLs (containing file names) must be quoted and URL escaped

Since the posLink_url also adds a non-URL attribute, the quoting and  URL-escaping
must happen inside posLink_url (otherwise the non-URL attribute becomes part or the
URL portion of the tag.

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