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

13 years agogodoc: remove last vestiges of old template system
Robert Griesemer [Fri, 12 Aug 2011 22:43:10 +0000 (15:43 -0700)]
godoc: remove last vestiges of old template system

- rename template funcs for better consistency and
  sort them into groups of related functionality
- try to be more consistent with html vs url escaping

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

13 years agogodoc: first round of template cleanups
Robert Griesemer [Fri, 12 Aug 2011 17:06:32 +0000 (10:06 -0700)]
godoc: first round of template cleanups

- simplified pipelines
- simplified templates by using template variables
- converted most old-style formatters into new-style funcs
- fixed some escaping bugs (use of url escaping where it was missing)

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

13 years agoexp/norm: generate trie struct in triegen.go for better encapsulation.
Marcel van Lohuizen [Fri, 12 Aug 2011 16:00:31 +0000 (18:00 +0200)]
exp/norm: generate trie struct in triegen.go for better encapsulation.

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

13 years agoexp/norm: generate trie struct in triegen.go for better encapsulation.
Marcel van Lohuizen [Fri, 12 Aug 2011 15:44:14 +0000 (17:44 +0200)]
exp/norm: generate trie struct in triegen.go for better encapsulation.

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

13 years agolib/godoc: fix typo
Mikio Hara [Fri, 12 Aug 2011 12:42:42 +0000 (22:42 +1000)]
lib/godoc: fix typo

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

13 years agocrypto, exec, path, time: add support for OpenBSD
Joel Sing [Fri, 12 Aug 2011 04:44:16 +0000 (14:44 +1000)]
crypto, exec, path, time: add support for OpenBSD

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

13 years agoexp/template/html: New package with a toy template transformation.
Mike Samuel [Fri, 12 Aug 2011 04:34:29 +0000 (14:34 +1000)]
exp/template/html: New package with a toy template transformation.

func Reverse(*Template) *Template
returns a template that produces the reverse of the original
for any input.

Changes outside exp/template/html include:
- Adding a getter for a template's FuncMap so that derived templates
  can inherit function definitions.
- Exported one node factory function, newIdentifier.
  Deriving tempaltes requires constructing new nodes, but I didn't
  export all of them because I think shallow copy functions might
  be more useful for this kind of work.
- Bugfix: Template's Name() method ignores the name field so
  template.New("foo") is a nil dereference instead of "foo".

Caveats: Reverse is a toy.  It is not UTF-8 safe, and does not
preserve order of calls to funcs in FuncMap.

For context, see http://groups.google.com/group/golang-nuts/browse_thread/thread/e8bc7c771aae3f20/b1ac41dc6f609b6e?lnk=gst

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

13 years agoCLA: Add Mike Samuel, Googler.
Rob Pike [Fri, 12 Aug 2011 04:31:12 +0000 (14:31 +1000)]
CLA: Add Mike Samuel, Googler.

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

13 years agoexp/template: fix implementation of printValue.
David Symonds [Fri, 12 Aug 2011 03:29:56 +0000 (13:29 +1000)]
exp/template: fix implementation of printValue.

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

13 years agoutf8: rename some internal constants to remove leading underscores.
Rob Pike [Fri, 12 Aug 2011 01:50:46 +0000 (11:50 +1000)]
utf8: rename some internal constants to remove leading underscores.
How quaint.

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

13 years agoexp/template: add builtin len function
Rob Pike [Fri, 12 Aug 2011 01:47:44 +0000 (11:47 +1000)]
exp/template: add builtin len function

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

13 years agogodoc: moving to new template package
Robert Griesemer [Thu, 11 Aug 2011 20:24:13 +0000 (13:24 -0700)]
godoc: moving to new template package

- first step; rough conversion of all template files
- there is plenty of opportunity for cleanups/simplifications (next CLs)
- html and text output as before

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

13 years agohtml: parse more malformed tags.
Nigel Tao [Thu, 11 Aug 2011 08:49:09 +0000 (18:49 +1000)]
html: parse more malformed tags.

This continues the work in revision 914a659b44ff, now passing more test
cases. As before, the new tokenization tests match html5lib's behavior.

Fixes #2124.

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

13 years agoexp/template: find the String method by taking the address if we need to.
Rob Pike [Thu, 11 Aug 2011 04:36:51 +0000 (14:36 +1000)]
exp/template: find the String method by taking the address if we need to.
Also simplify nil handling in printing.

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

13 years agoexp/template: rename Parse*File and Parse*Files for clarity
Gustavo Niemeyer [Thu, 11 Aug 2011 04:28:48 +0000 (23:28 -0500)]
exp/template: rename Parse*File and Parse*Files for clarity

IMPORTANT: Previous usage of *Files will continue to compile
fine but misbehave since the interface is compatible.

The following functions have been renamed:

    ParseFiles => ParseGlob
    ParseFile => ParseFiles
    ParseSetFiles => ParseSetGlob
    ParseSetFile => ParseSetFiles
    ParseTemplateFiles => ParseTemplateGlob
    ParseTemplateFile => ParseTemplateFiles

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

13 years agoruntime: better checks for syscall.NewCallback parameter
Alex Brainman [Thu, 11 Aug 2011 02:23:55 +0000 (12:23 +1000)]
runtime: better checks for syscall.NewCallback parameter

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

13 years agocodereview: set status while committing CL
Russ Cox [Thu, 11 Aug 2011 01:36:59 +0000 (21:36 -0400)]
codereview: set status while committing CL

Not sure how to detect read-only but at least
this pins the blame on the hg server.

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

13 years agobuild: allow builds without cgo
Russ Cox [Thu, 11 Aug 2011 01:36:48 +0000 (21:36 -0400)]
build: allow builds without cgo

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

13 years agoexp/template: truth for interface values.
Rob Pike [Wed, 10 Aug 2011 22:27:16 +0000 (08:27 +1000)]
exp/template: truth for interface values.
Also protect against invalid (zero Value) reflect.Values.

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

13 years agohttp: corrects undocumented side effects in http.DefaultTransport's RoundTrip method
Dave Grijalva [Wed, 10 Aug 2011 21:16:13 +0000 (14:16 -0700)]
http: corrects undocumented side effects in http.DefaultTransport's RoundTrip method
Fixes #2140.

The http.DefaultTransport's RoundTrip method leaves the http.Request object
in an altered state after performing the round trip.  This patch removes
the header from the Request before returning to the client.

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

13 years agoA+C: Dave Grijalva (ngmoco CLA)
Brad Fitzpatrick [Wed, 10 Aug 2011 21:05:52 +0000 (14:05 -0700)]
A+C: Dave Grijalva (ngmoco CLA)

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

13 years agohttp: fix ParseMultipartForm after MultipartReader error
Brad Fitzpatrick [Wed, 10 Aug 2011 15:08:53 +0000 (08:08 -0700)]
http: fix ParseMultipartForm after MultipartReader error

Addresses part of issue 2093
Thanks to espians....@

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

13 years agoexp/norm: added trie lookup code and associated tests.
Marcel van Lohuizen [Wed, 10 Aug 2011 13:36:27 +0000 (15:36 +0200)]
exp/norm: added trie lookup code and associated tests.
- triegen.go: Factored out trie generation code from maketables.go
  (only renamed printTrieTables to printTables and made it a method).
- maketesttables.go: new tool to generate data for the trie unit test.
- Makefile: changed accordingly.
- trie.go: trie lookup code.
- trietest_data.go: generated by maketesttables.go.
- trie_test.go: unit test for trie.go.

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

13 years agoexp/norm: added trie lookup code and associated tests.
Marcel van Lohuizen [Wed, 10 Aug 2011 13:34:12 +0000 (15:34 +0200)]
exp/norm: added trie lookup code and associated tests.
- triegen.go: Factored out trie generation code from maketables.go
  (only renamed printTrieTables to printTables and made it a method).
- maketesttables.go: new tool to generate data for the trie unit test.
- Makefile: changed accordingly.
- trie.go: trie lookup code.
- trietest_data.go: generated by maketesttables.go.
- trie_test.go: unit test for trie.go.

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

13 years agojson: fix []unmarshaler case
Russ Cox [Wed, 10 Aug 2011 13:26:51 +0000 (09:26 -0400)]
json: fix []unmarshaler case

Now that reflect has v.Addr(), we can use it.

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

13 years agotime: allow the input to have fractional seconds even if
Rob Pike [Wed, 10 Aug 2011 13:24:45 +0000 (23:24 +1000)]
time: allow the input to have fractional seconds even if
the format string does not specify its presence.

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

13 years agoruntime: correct seh installation during callbacks
Alex Brainman [Wed, 10 Aug 2011 07:17:28 +0000 (17:17 +1000)]
runtime: correct seh installation during callbacks

Every time we enter callback from Windows, it is
possible that go exception handler is not at the top
of per-thread exception handlers chain. So it needs
to be installed again. At this moment this is done
by replacing top SEH frame with SEH frame as at time
of syscall for the time of callback. This is incorrect,
because, if exception strike, we won't be able to call
any exception handlers installed inside syscall,
because they are not in the chain. This changes
procedure to add new SEH frame on top of existing
chain instead.

I also removed m sehframe field, because I don't
think it is needed. We use single global exception
handler everywhere.

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

13 years agotag weekly.2011-08-10
Nigel Tao [Wed, 10 Aug 2011 06:05:31 +0000 (16:05 +1000)]
tag weekly.2011-08-10

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

13 years agoweekly.2011-08-10 weekly.2011-08-10
Nigel Tao [Wed, 10 Aug 2011 06:00:22 +0000 (16:00 +1000)]
weekly.2011-08-10

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

13 years agotiming.log: significant improvements after custom algorithms
Rob Pike [Wed, 10 Aug 2011 05:45:37 +0000 (15:45 +1000)]
timing.log: significant improvements after custom algorithms
See https://golang.org/cl/4815087

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

13 years agohtml: parse malformed tags missing a '>', such as `<p id=0</p>`.
Nigel Tao [Wed, 10 Aug 2011 03:39:07 +0000 (13:39 +1000)]
html: parse malformed tags missing a '>', such as `<p id=0</p>`.

The additional token_test.go cases matches html5lib behavior.

Fixes #2124.

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

13 years agold: add one empty symbol into pe to make dumpbin works.
Wei Guangjing [Wed, 10 Aug 2011 01:09:06 +0000 (11:09 +1000)]
ld: add one empty symbol into pe to make dumpbin works.

Fixes #2139.

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

13 years agohttp: configurable and default request header size limit
Brad Fitzpatrick [Tue, 9 Aug 2011 17:55:14 +0000 (10:55 -0700)]
http: configurable and default request header size limit

This addresses the biggest DoS in issue 2093

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

13 years agohttp: add test to serve content in index.html
Yasuhiro Matsumoto [Tue, 9 Aug 2011 17:25:53 +0000 (10:25 -0700)]
http: add test to serve content in index.html

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

13 years agoexp/template: do not take address of interface variable to find methods.
Rob Pike [Tue, 9 Aug 2011 07:07:29 +0000 (17:07 +1000)]
exp/template: do not take address of interface variable to find methods.
Also allow struct values as "with" targets.

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

13 years agoexp/template: remove reflect from the API
Rob Pike [Tue, 9 Aug 2011 06:49:36 +0000 (16:49 +1000)]
exp/template: remove reflect from the API
It means keeping two sets of maps, but things look cleaner from
the outside.

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

13 years agoexp/template: split the parse tree into a separate package exp/template/parse
Rob Pike [Tue, 9 Aug 2011 05:42:53 +0000 (15:42 +1000)]
exp/template: split the parse tree into a separate package exp/template/parse

Mostly a mechanical change, with a few cleanups to make the split easier.
The external interface to exp/template is unaffected.

In another round I will play with the function map setup to see if I can
avoid exposing reflect across the boundary, but that will require some
structural changes I did not want to mix into this CL.

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

13 years agocrypto/x509, go/scanner, index/suffixarray: Removed []interface{}/vector uses.
Kyle Consalus [Mon, 8 Aug 2011 21:32:37 +0000 (14:32 -0700)]
crypto/x509, go/scanner, index/suffixarray: Removed []interface{}/vector uses.

Changed some []interface{} uses to slices of the concrete types; removed use of IntVector.

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

13 years agoscanner: correct error position for illegal UTF-8 encodings
Robert Griesemer [Mon, 8 Aug 2011 20:54:32 +0000 (13:54 -0700)]
scanner: correct error position for illegal UTF-8 encodings

- added corresponding test cases
- re-grouped tests for better readability

Fixes #2138.

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

13 years agocontainer/vector: removed last instances of vector outside of container/vector itself...
John Asmuth [Mon, 8 Aug 2011 18:27:09 +0000 (11:27 -0700)]
container/vector: removed last instances of vector outside of container/vector itself from the core libs

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

13 years agosyscall: move bsd mmap syscall
Joel Sing [Mon, 8 Aug 2011 13:56:45 +0000 (09:56 -0400)]
syscall: move bsd mmap syscall

The mmap system call varies across BSDs. Move mmap and munmap into
the operating system dependent files. This will be needed to add
syscall support for OpenBSD.

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

13 years agonet: add support for openbsd
Joel Sing [Mon, 8 Aug 2011 13:56:42 +0000 (09:56 -0400)]
net: add support for openbsd

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

13 years agoruntime: openbsd amd64 runtime support
Joel Sing [Mon, 8 Aug 2011 13:56:38 +0000 (09:56 -0400)]
runtime: openbsd amd64 runtime support

Add support for the go runtime on openbsd/amd64. This is based on
the existing freebsd runtime.

Threads are implemented using OpenBSD's rthreads, which are currently
disabled by default, however can be enabled via the kern.rthreads
sysctl.

For now, cgo is disabled.

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

13 years agoos: add support for openbsd
Joel Sing [Mon, 8 Aug 2011 13:56:36 +0000 (09:56 -0400)]
os: add support for openbsd

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

13 years agoexp/template: document that comments may span newlines.
Rob Pike [Mon, 8 Aug 2011 13:42:49 +0000 (23:42 +1000)]
exp/template: document that comments may span newlines.

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

13 years agoruntime: add more specialized type algorithms
Dmitriy Vyukov [Mon, 8 Aug 2011 13:35:32 +0000 (09:35 -0400)]
runtime: add more specialized type algorithms
The change adds specialized type algorithms
for slices and types of size 8/16/32/64/128.
It significantly accelerates chan and map operations
for most builtin types as well as user structs.

benchmark                   old,ns/op   new,ns/op
BenchmarkChanUncontended          226          94
(on Intel Xeon E5620, 2.4GHz, Linux 64 bit)

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

13 years agoexp/template: url filter.
David Symonds [Mon, 8 Aug 2011 06:29:57 +0000 (16:29 +1000)]
exp/template: url filter.

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

13 years agoexp/template: fix Must example.
David Symonds [Mon, 8 Aug 2011 05:38:37 +0000 (15:38 +1000)]
exp/template: fix Must example.

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

13 years agotime: parse and format fractional seconds
Rob Pike [Sun, 7 Aug 2011 21:50:17 +0000 (07:50 +1000)]
time: parse and format fractional seconds

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

13 years agogofmt: update test script so 'make test' succeeds
Robert Griesemer [Sat, 6 Aug 2011 19:30:54 +0000 (12:30 -0700)]
gofmt: update test script so 'make test' succeeds

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

13 years agoFAQ: variant types, unions
Rob Pike [Sat, 6 Aug 2011 01:21:59 +0000 (11:21 +1000)]
FAQ: variant types, unions
Fixes #1935.

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

13 years agoFAQ: lots of small tweaks plus a couple of new discussions.
Rob Pike [Fri, 5 Aug 2011 21:41:55 +0000 (07:41 +1000)]
FAQ: lots of small tweaks plus a couple of new discussions.
Expand the conversations about pointers, memory, and
garbage collection.
Describe the lack of co/contravariant typing.

Fixes #1929.
Fixes #1930.

R=dsymonds, r, mirtchovski, edsrzf, hanwen, rsc
CC=golang-dev
https://golang.org/cl/4852041

13 years agotime: fix windows build
Alex Brainman [Fri, 5 Aug 2011 07:19:17 +0000 (17:19 +1000)]
time: fix windows build

R=golang-dev, mattn.jp, dsymonds
CC=golang-dev
https://golang.org/cl/4849042

13 years agoasn1: fix build
Rob Pike [Fri, 5 Aug 2011 05:10:06 +0000 (15:10 +1000)]
asn1: fix build

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

13 years agotime: add nanoseconds to the Time structure.
Rob Pike [Fri, 5 Aug 2011 03:44:02 +0000 (13:44 +1000)]
time: add nanoseconds to the Time structure.

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

13 years agonet: implement windows LookupMX and LookupAddr
Alex Brainman [Fri, 5 Aug 2011 00:27:51 +0000 (10:27 +1000)]
net: implement windows LookupMX and LookupAddr

Also sort SRV records before returning from LookupSRV.

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

13 years agonet: fix /proc/net/igmp,igmp6 reading bug on linux
Mikio Hara [Thu, 4 Aug 2011 23:20:13 +0000 (09:20 +1000)]
net: fix /proc/net/igmp,igmp6 reading bug on linux

Fixes #2130.

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

13 years agoexp/norm: fix build by adding a test placeholder
Rob Pike [Thu, 4 Aug 2011 22:25:49 +0000 (08:25 +1000)]
exp/norm: fix build by adding a test placeholder

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

13 years agoexp/norm: maketables tool for generating tables for normalization.
Marcel van Lohuizen [Thu, 4 Aug 2011 21:15:19 +0000 (23:15 +0200)]
exp/norm: maketables tool for generating tables for normalization.

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

13 years agoruntime: faster chan creation on Linux/FreeBSD/Plan9
Dmitriy Vyukov [Thu, 4 Aug 2011 12:31:03 +0000 (08:31 -0400)]
runtime: faster chan creation on Linux/FreeBSD/Plan9
The change removes chan finalizer (Lock destructor)
if it is not required on the platform.

benchmark                    old ns/op    new ns/op    delta
BenchmarkChanCreation          1132.00       381.00  -66.34%
BenchmarkChanCreation-2        1215.00       243.00  -80.00%
BenchmarkChanCreation-4        1084.00       186.00  -82.84%
BenchmarkChanCreation-8        1415.00       154.00  -89.12%
BenchmarkChanCreation-16       1386.00       144.00  -89.61%
(on 2 x Intel Xeon E5620, 8 HT cores, 2.4 GHz, Linux)

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

13 years agohttp: correct path to serve index.html.
Yasuhiro Matsumoto [Thu, 4 Aug 2011 12:20:53 +0000 (08:20 -0400)]
http: correct path to serve index.html.
calling filepath.FromSlash(x) make invalid character to serve file.
Fixes #2128

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

13 years agohttp: add more MPEG-4 MIME types to sniffer, and disable MP4 sniffing.
David Symonds [Thu, 4 Aug 2011 12:10:17 +0000 (22:10 +1000)]
http: add more MPEG-4 MIME types to sniffer, and disable MP4 sniffing.

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

13 years agofmt: call UpdateMemStats in malloc counter
Rob Pike [Thu, 4 Aug 2011 06:32:14 +0000 (16:32 +1000)]
fmt: call UpdateMemStats in malloc counter

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

13 years agogob: avoid a couple of init-time allocations.
David Symonds [Thu, 4 Aug 2011 06:22:22 +0000 (16:22 +1000)]
gob: avoid a couple of init-time allocations.

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

13 years agogob: add UpdateMemStats calls to malloc counter
Rob Pike [Thu, 4 Aug 2011 05:56:25 +0000 (15:56 +1000)]
gob: add UpdateMemStats calls to malloc counter

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

13 years agogob: don't invoke GobEncoder on zero values.
Rob Pike [Thu, 4 Aug 2011 04:39:44 +0000 (14:39 +1000)]
gob: don't invoke GobEncoder on zero values.

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

13 years agonet: joined group addresses for a specific interface for darwin, freebsd, linux
Mikio Hara [Thu, 4 Aug 2011 04:22:52 +0000 (00:22 -0400)]
net: joined group addresses for a specific interface for darwin, freebsd, linux

This CL enables to list the multicast, joined group addresses
for a specific interface by using Interface.MulticastAddrs
method.

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

13 years agosyscall: update routing message support for BSD variants
Mikio Hara [Thu, 4 Aug 2011 04:22:48 +0000 (00:22 -0400)]
syscall: update routing message support for BSD variants

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

13 years agoruntime: remove unnecessary locking
Hector Chu [Thu, 4 Aug 2011 04:22:39 +0000 (00:22 -0400)]
runtime: remove unnecessary locking

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

13 years agotest/bench: note changes after recent improvements to locking and runtime
Rob Pike [Thu, 4 Aug 2011 01:29:20 +0000 (11:29 +1000)]
test/bench: note changes after recent improvements to locking and runtime
Some tests are significantly faster (50%), a few are slower (up to 30%).
Fannkuch is confusing: parallel code is a little slower for gc, non-parallel and all gccgo runs are faster.

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

13 years agoruntime: correct Note documentation
Dmitriy Vyukov [Wed, 3 Aug 2011 19:51:55 +0000 (15:51 -0400)]
runtime: correct Note documentation
Reflect the fact that notesleep() can be called
by exactly one thread.

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

13 years agomisc/vim: Godoc command.
Yasuhiro Matsumoto [Wed, 3 Aug 2011 06:46:35 +0000 (16:46 +1000)]
misc/vim: Godoc command.
vim command 'Godoc' to see godoc.

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

13 years agoerrchk: add -0 flag
Russ Cox [Tue, 2 Aug 2011 19:19:44 +0000 (15:19 -0400)]
errchk: add -0 flag

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

13 years agold: fail linking if the top-level package is not main.
David Symonds [Tue, 2 Aug 2011 11:45:04 +0000 (07:45 -0400)]
ld: fail linking if the top-level package is not main.

This makes {5,6,8}l conform to the spec more tightly.

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

13 years agoexp/template: return nil value from helpers on error, even methods.
Rob Pike [Tue, 2 Aug 2011 03:02:52 +0000 (20:02 -0700)]
exp/template: return nil value from helpers on error, even methods.

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

13 years agogo/build: use GOBIN as binary path for GOROOT
Andrew Gerrand [Tue, 2 Aug 2011 02:17:23 +0000 (19:17 -0700)]
go/build: use GOBIN as binary path for GOROOT

Fixes #2106.

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

13 years agotag release.r59
Andrew Gerrand [Mon, 1 Aug 2011 21:20:02 +0000 (14:20 -0700)]
tag release.r59

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

13 years agoexp/template: make index function on maps return zero value when key not present.
Roger Peppe [Mon, 1 Aug 2011 16:03:35 +0000 (09:03 -0700)]
exp/template: make index function on maps return zero value when key not present.

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

13 years agoexp/template: ensure that a valid Set is returned even on error.
Roger Peppe [Mon, 1 Aug 2011 16:02:06 +0000 (09:02 -0700)]
exp/template: ensure that a valid Set is returned even on error.

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

13 years ago5g: fix set but not used error
Dave Cheney [Mon, 1 Aug 2011 02:54:47 +0000 (19:54 -0700)]
5g: fix set but not used error

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

13 years agohttp: correct format flags when printing errors during tests
Alex Brainman [Mon, 1 Aug 2011 01:50:50 +0000 (11:50 +1000)]
http: correct format flags when printing errors during tests

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

13 years agocmd/ld/pe.c: Corrected mismatched print formats and variables.
Lucio De Re [Mon, 1 Aug 2011 01:12:50 +0000 (11:12 +1000)]
cmd/ld/pe.c: Corrected mismatched print formats and variables.

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