]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoexp/norm: added normregtest to .hgignore.
Marcel van Lohuizen [Wed, 14 Sep 2011 18:03:21 +0000 (20:03 +0200)]
exp/norm: added normregtest to .hgignore.

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

13 years agotest: Add test for inheriting private method from anonymous field.
Ian Lance Taylor [Wed, 14 Sep 2011 17:31:51 +0000 (10:31 -0700)]
test: Add test for inheriting private method from anonymous field.

The spec says that all methods are inherited from an anonymous
field.  There is no exception for non-exported methods.

This is related to issue 1536.

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

13 years agogo/printer: use panic/defer instead of goroutine
Robert Griesemer [Wed, 14 Sep 2011 15:49:21 +0000 (08:49 -0700)]
go/printer: use panic/defer instead of goroutine
for handling errors

Fixes #2249.

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

13 years agogofmt: add else test
Russ Cox [Wed, 14 Sep 2011 15:29:18 +0000 (11:29 -0400)]
gofmt: add else test

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

13 years agowebsocket: rename websocket.WebSocketAddr to *websocket.Addr.
Russ Cox [Wed, 14 Sep 2011 15:29:11 +0000 (11:29 -0400)]
websocket: rename websocket.WebSocketAddr to *websocket.Addr.

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

13 years agoruntime: track HeapIdle
Russ Cox [Wed, 14 Sep 2011 15:29:01 +0000 (11:29 -0400)]
runtime: track HeapIdle

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

13 years agoimage/jpeg: fix build
Mikio Hara [Wed, 14 Sep 2011 15:14:03 +0000 (11:14 -0400)]
image/jpeg: fix build

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

13 years agoimage/draw: unbreak build for image.NewXxx change.
Nigel Tao [Wed, 14 Sep 2011 12:09:46 +0000 (22:09 +1000)]
image/draw: unbreak build for image.NewXxx change.

TBR=rsc
CC=golang-dev
https://golang.org/cl/5016044

13 years agoimage: change the NewXxx functions to take a Rectangle instead of
Nigel Tao [Wed, 14 Sep 2011 11:39:49 +0000 (21:39 +1000)]
image: change the NewXxx functions to take a Rectangle instead of
taking (w, h int).

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

13 years agoruntime: syscall to return both AX and DX for windows/386
Alex Brainman [Wed, 14 Sep 2011 06:19:45 +0000 (16:19 +1000)]
runtime: syscall to return both AX and DX for windows/386

Fixes #2181.

R=golang-dev, jp
CC=golang-dev
https://golang.org/cl/5000042

13 years agotemplate: add doc.go to Makefile
Mike Samuel [Wed, 14 Sep 2011 01:50:02 +0000 (18:50 -0700)]
template: add doc.go to Makefile

The template package is the only one that has a doc.go not mentioned
in its Makefile.

This doesn't seem to bother godoc, but seems like a bug to me.

$ for d in $(find pkg -name doc.go); do echo $d; grep doc.go $(dirname $d)/Makefile; done
pkg/fmt/doc.go
        doc.go\
pkg/go/doc/doc.go
        doc.go\
pkg/gob/doc.go
        doc.go\
pkg/html/doc.go
        doc.go\
pkg/old/template/doc.go
        doc.go\
pkg/sync/atomic/doc.go
        doc.go\
pkg/template/doc.go

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

13 years agoexp/template/html: move transition functions to a separate file
Mike Samuel [Wed, 14 Sep 2011 00:53:55 +0000 (17:53 -0700)]
exp/template/html: move transition functions to a separate file

This CL moves code but makes no changes otherwise.

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

13 years agopath/filepath: new signature for Walk
Rob Pike [Wed, 14 Sep 2011 00:47:59 +0000 (17:47 -0700)]
path/filepath: new signature for Walk
This one uses a closure than an interface, and is much simpler to use.
It also enables a called function to return an error and (possibly)
halt processing.

Fixes #2237.

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

13 years agoexp/template/html: escape {{template}} calls and sets of templates
Mike Samuel [Tue, 13 Sep 2011 23:57:39 +0000 (16:57 -0700)]
exp/template/html: escape {{template}} calls and sets of templates

This adds support for {{template "callee"}} calls.
It recognizes that calls can appear in many contexts.

{{if .ImageURL}}
    <img src="{{.ImageURL}}" alt="{{template "description"}}">
{{else}}
    <p>{{template "description"}}</p>
{{end}}

calls a template in two different contexts, first in an HTML attribute
context, and second in an HTML text context.

Those two contexts aren't very different, but when linking text
to search terms, the escaping context can be materially different:

<a href="/search?q={{template "tags"}}">{{template "tags"}}</a>

This adds API:
EscapeSet(*template.Set, names ...string) os.Error

takes a set of templates and the names of those which might be called
in the default context as starting points.

It changes the escape* functions to be methods of an object which
maintains a conceptual mapping of
(template names*input context) -> output context.

The actual mapping uses as key a mangled name which combines the
template name with the input context.

The mangled name when the input context is the default context is the
same as the unmangled name.

When a template is called in multiple contexts, we clone the template.

{{define "tagLink"}}
  <a href="/search?q={{template "tags"}}">{{template "tags"}}</a>
{{end}}
{{define "tags"}}
  {{range .Tags}}{{.}},{{end}}
{{end}}

given []string{ "foo", "O'Reilly", "bar" } produces

  <a href="/search?q=foo,O%27Reilly,bar">foo,O&#39;Reilly,bar</a>

This involves rewriting the above to something like

{{define "tagLink"}}
  <a href="/search?q={{template "tags$1"}}">{{template "tags"}}</a>
{{end}}
{{define "tags"}}
  {{range .Tags}}{{. | html}},{{end}}
{{end}}
{{define "tags$1"}}
  {{range .Tags}}{{. | urlquery}},{{end}}
{{end}}

clone.go provides a mechanism for cloning template "tags" to produce
"tags$1".

changes to escape.go implement the new API and context propagation
around the call graph.

context.go includes minor changes to support name mangling and
context_test.go tests those.

js.go contains a bug-fix.

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

13 years agohttp: Alphabetize imports.
Ian Lance Taylor [Tue, 13 Sep 2011 16:38:26 +0000 (09:38 -0700)]
http: Alphabetize imports.

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

13 years agoos: Fix comment in generated signal_unix.go file.
Ian Lance Taylor [Tue, 13 Sep 2011 16:38:08 +0000 (09:38 -0700)]
os: Fix comment in generated signal_unix.go file.

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

13 years agoexp/norm: Added regression test tool for the standard Unicode test set.
Marcel van Lohuizen [Tue, 13 Sep 2011 10:51:48 +0000 (12:51 +0200)]
exp/norm: Added regression test tool for the standard Unicode test set.

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

13 years agonet: add a LookupTXT function.
Nigel Tao [Tue, 13 Sep 2011 03:05:33 +0000 (13:05 +1000)]
net: add a LookupTXT function.

This CL only supports Unix, not Plan 9 or Windows.

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

13 years agotime: another attempt to fix windows build
Alex Brainman [Tue, 13 Sep 2011 02:42:24 +0000 (12:42 +1000)]
time: another attempt to fix windows build

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

13 years agotime: fix Windows build after ceeedb519c4a
Brad Fitzpatrick [Tue, 13 Sep 2011 00:18:25 +0000 (17:18 -0700)]
time: fix Windows build after ceeedb519c4a

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

13 years agoexp/template/html: tolerate '/' ambiguity in JS when it doesn't matter.
Mike Samuel [Mon, 12 Sep 2011 23:37:03 +0000 (16:37 -0700)]
exp/template/html: tolerate '/' ambiguity in JS when it doesn't matter.

Often, division/regexp ambiguity doesn't matter in JS because the next
token is not a slash.

For example, in

  <script>var global{{if .InitVal}} = {{.InitVal}}{{end}}</script>

When there is an initial value, the {{if}} ends with jsCtxDivOp
since a '/' following {{.InitVal}} would be a division operator.
When there is none, the empty {{else}} branch ends with jsCtxRegexp
since a '/' would start a regular expression.  A '/' could result
in a valid program if it were on a new line to allow semicolon
insertion to terminate the VarDeclaration.

There is no '/' though, so we can ignore the ambiguity.

There are cases where a missing semi can result in ambiguity that
we should report.

  <script>
  {{if .X}}var x = {{.X}}{{end}}
  /...{{.Y}}
  </script>

where ... could be /foo/.test(bar) or /divisor.  Disambiguating in
this case is hard and is required to sanitize {{.Y}}.

Note, that in the case where there is a '/' in the script tail but it
is not followed by any interpolation, we already don't care.  So we
are already tolerant of

<script>{{if .X}}var x = {{.X}}{{end}}/a-bunch-of-text</script>

because tJS checks for </script> before looking in /a-bunch-of-text.

This CL
- Adds a jsCtx value: jsCtxUnknown
- Changes joinContext to join contexts that only differ by jsCtx.
- Changes tJS to return an error when a '/' is seen in jsCtxUnknown.
- Adds tests for both the happy and sad cases.

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

13 years agoexp/template/html: fix bug /*/ is not a full JS block comment.
Mike Samuel [Mon, 12 Sep 2011 23:01:30 +0000 (16:01 -0700)]
exp/template/html: fix bug /*/ is not a full JS block comment.

Similar tests for CSS already catch this problem in tCSS.

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

13 years agocrypto/tls: handle non-TLS more robustly
Russ Cox [Mon, 12 Sep 2011 20:52:49 +0000 (16:52 -0400)]
crypto/tls: handle non-TLS more robustly

Fixes #2253.

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

13 years agogc: clean up if grammar
Russ Cox [Mon, 12 Sep 2011 19:52:29 +0000 (15:52 -0400)]
gc: clean up if grammar

Fixes #2248.

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

13 years agogofmt: accept program fragments on standard input
Russ Cox [Mon, 12 Sep 2011 19:41:49 +0000 (15:41 -0400)]
gofmt: accept program fragments on standard input

This makes it possible to grab a block of code
in an editor and pipe it through gofmt, instead of
having to pipe in the entire file.

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

13 years agogodoc, suffixarray: switch to exp/regexp
Robert Griesemer [Mon, 12 Sep 2011 19:20:48 +0000 (12:20 -0700)]
godoc, suffixarray: switch to exp/regexp

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

13 years agopath/filepath: fix Visitor doc
Gustavo Niemeyer [Mon, 12 Sep 2011 19:18:48 +0000 (16:18 -0300)]
path/filepath: fix Visitor doc

The path is not in fact relative to the root, but
joined to it.

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

13 years agotime: make Weekday a method.
Rob Pike [Mon, 12 Sep 2011 18:47:55 +0000 (11:47 -0700)]
time: make Weekday a method.
Weekday is redundant information for a Time structure.
When parsing a time with a weekday specified, it can create an
incorrect Time value.
When parsing a time without a weekday specified, people
expect the weekday to be set.
Fix all three problems by computing the weekday on demand.

This is hard to gofix, since we must change the type of the node.
Since uses are rare and existing code will be caught by the compiler,
there is no gofix module here.

Fixes #2245.

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

13 years agoexp/regexp/syntax: fix invalid input parser crash
Russ Cox [Mon, 12 Sep 2011 18:03:53 +0000 (14:03 -0400)]
exp/regexp/syntax: fix invalid input parser crash

Reported by Kyle Lemons.

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

13 years agowebsocket: Fix infinite recursion in WebSockAddr String()
Tarmigan Casebolt [Mon, 12 Sep 2011 17:48:56 +0000 (13:48 -0400)]
websocket: Fix infinite recursion in WebSockAddr String()

String() is already inherited from the embedded *url.URL

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

13 years agoexp/norm: fixed typo. Bug exposed by gomake testtables. Changes did not affect other...
Marcel van Lohuizen [Mon, 12 Sep 2011 08:21:35 +0000 (10:21 +0200)]
exp/norm: fixed typo. Bug exposed by gomake testtables. Changes did not affect other tests
as this part of Hangul is handled algorithmically.

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

13 years agoexp/template/html: fix JS regexp escape of an empty string.
Nigel Tao [Mon, 12 Sep 2011 01:57:34 +0000 (11:57 +1000)]
exp/template/html: fix JS regexp escape of an empty string.

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

13 years agoimage/png: don't use a goroutine to decode. This was preventing
Nigel Tao [Fri, 9 Sep 2011 23:51:13 +0000 (09:51 +1000)]
image/png: don't use a goroutine to decode. This was preventing
decoding during an init function.

Fixes #2224.

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

13 years agodoc: link to notable blog posts
Andrew Gerrand [Fri, 9 Sep 2011 23:35:25 +0000 (09:35 +1000)]
doc: link to notable blog posts

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

13 years agold: grow dwarf includestack on demand.
Luuk van Dijk [Fri, 9 Sep 2011 13:08:57 +0000 (15:08 +0200)]
ld: grow dwarf includestack on demand.

Fixes #2241
while not breaking issue 1878 again.

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

13 years agopath/filepath: make UNC file names work
Yasuhiro Matsumoto [Fri, 9 Sep 2011 07:38:29 +0000 (17:38 +1000)]
path/filepath: make UNC file names work

Fixes #2201

R=golang-dev, r, rsc, alex.brainman, robert.hencke, jp
CC=golang-dev
https://golang.org/cl/4950051

13 years agoexp/template/html: Grammar rules for HTML comments and special tags.
Mike Samuel [Fri, 9 Sep 2011 07:07:40 +0000 (00:07 -0700)]
exp/template/html: Grammar rules for HTML comments and special tags.

Augments type context and adds grammatical rules to handle special HTML constructs:
    <!-- comments -->
    <script>raw text</script>
    <textarea>no tags here</textarea>

This CL does not elide comment content.  I recommend we do that but
have not done it in this CL.

I used a codesearch tool over a codebase in another template language.

Based on the below I think we should definitely recognize
  <script>, <style>, <textarea>, and <title>
as each of these appears frequently enough that there are few
template using apps that do not use most of them.

Of the other special tags,
  <xmp>, <noscript>
are used but infrequently, and
  <noframe> and friend, <listing>
do not appear at all.

We could support <xmp> even though it is obsolete in HTML5
because we already have the machinery, but I suggest we do not
support noscript since it is a normal tag in some browser
configurations.

I suggest recognizing and eliding <!-- comments -->
(but not escaping text spans) as they are widely used to
embed comments in template source.  Not eliding them increases
the size of content sent over the network, and risks leaking
code and project internal details.
The template language I tested elides them so there are
no instance of IE conditional compilation directives in the
codebase but that could be a source of confusion.

The codesearch does the equivalent of
$ find . -name \*.file-extension \
  | perl -ne 'print "\L$1\n" while s@<([a-z][a-z0-9])@@i' \
  | sort | uniq -c | sort

The 5 uses of <plaintext> seem to be in tricky code and can be ignored.
The 2 uses of <xmp> appear in the same tricky code and can be ignored.
I also ignored end tags to avoid biasing against unary
elements and threw out some nonsense names since since the
long tail is dominated by uses of < as a comparison operator
in the template languages expression language.

I have added asterisks next to abnormal elements.

  26765 div
   7432 span
   7414 td
   4233 a
   3730 tr
   3238 input
   2102 br
   1756 li
   1755 img
   1674 table
   1388 p
   1311 th
   1064 option
    992 b
    891 label
    714 script *
    519 ul
    446 tbody
    412 button
    381 form
    377 h2
    358 select
    353 strong
    318 h3
    314 body
    303 html
    266 link
    262 textarea *
    261 head
    258 meta
    225 title *
    189 h1
    176 col
    156 style *
    151 hr
    119 iframe
    103 h4
    101 pre
    100 dt
     98 thead
     90 dd
     83 map
     80 i
     69 object
     66 ol
     65 em
     60 param
     60 font
     57 fieldset
     51 string
     51 field
     51 center
     44 bidi
     37 kbd
     35 legend
     30 nobr
     29 dl
     28 var
     26 small
     21 cite
     21 base
     20 embed
     19 colgroup
     12 u
     12 canvas
     10 sup
     10 rect
     10 optgroup
     10 noscript *
      9 wbr
      9 blockquote
      8 tfoot
      8 code
      8 caption
      8 abbr
      7 msg
      6 tt
      6 text
      6 h5
      5 svg
      5 plaintext *
      5 article
      4 shortquote
      4 number
      4 menu
      4 ins
      3 progress
      3 header
      3 content
      3 bool
      3 audio
      3 attribute
      3 acronym
      2 xmp *
      2 overwrite
      2 objects
      2 nobreak
      2 metadata
      2 description
      2 datasource
      2 category
      2 action

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

13 years agogodoc: fine tuning of template file
Robert Griesemer [Fri, 9 Sep 2011 01:27:26 +0000 (18:27 -0700)]
godoc: fine tuning of template file

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

13 years agoos: forgotten file of submitted CL 4984051
Jaroslavas Počepko [Thu, 8 Sep 2011 23:39:23 +0000 (09:39 +1000)]
os: forgotten file of submitted CL 4984051

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

13 years agogodoc: show packages matching a query at the top
Robert Griesemer [Thu, 8 Sep 2011 22:35:56 +0000 (15:35 -0700)]
godoc: show packages matching a query at the top

Also: fix layout of textual search results and
fix a field reference in the respective template.

Fixes #1987.

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

13 years agoexp/template/html: autoescape actions in HTML style attributes.
Mike Samuel [Thu, 8 Sep 2011 21:18:20 +0000 (07:18 +1000)]
exp/template/html: autoescape actions in HTML style attributes.

This does not wire up <style> elements as that is pending support
for raw text content in CL https://golang.org/cl/4964045/

This CL allows actions to appear in contexts like

selectors:        {{.Tag}}{{.Class}}{{.Id}}
property names:   border-{{.BidiLeadingEdge}}
property values:  color: {{.Color}}
strings:          font-family: "{{font-name}}"
URL strings:      background: "/foo?image={{.ImgQuery}}"
URL literals:     background: url("{{.Image}}")

but disallows actions inside CSS comments and disallows
embedding of JS in CSS entirely.

It is based on the CSS3 lexical grammar with affordances for
common browser extensions including line comments.

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

13 years agoexp/regexp: add MustCompilePOSIX
Russ Cox [Thu, 8 Sep 2011 19:00:49 +0000 (15:00 -0400)]
exp/regexp: add MustCompilePOSIX

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

13 years agoexp/regexp: add CompilePOSIX, more tests
Russ Cox [Thu, 8 Sep 2011 18:49:51 +0000 (14:49 -0400)]
exp/regexp: add CompilePOSIX, more tests

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

13 years agoexp/regexp/syntax: import all RE2 parse tests + fix bugs
Russ Cox [Thu, 8 Sep 2011 18:18:02 +0000 (14:18 -0400)]
exp/regexp/syntax: import all RE2 parse tests + fix bugs

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

13 years agosyscall: add route flags for linux
Mikio Hara [Thu, 8 Sep 2011 17:59:34 +0000 (13:59 -0400)]
syscall: add route flags for linux

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

13 years agogodoc: fix local link for factory functions
Robert Griesemer [Thu, 8 Sep 2011 17:37:26 +0000 (10:37 -0700)]
godoc: fix local link for factory functions

- fix suggested by rodrigo.moraes

Fixes #1755.

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

13 years agoexp/regexp: leftmost-longest matching
Russ Cox [Thu, 8 Sep 2011 14:09:25 +0000 (10:09 -0400)]
exp/regexp: leftmost-longest matching

Not exposed in the API yet, but passes tests.

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

13 years agocodereview: Mercurial 1.9 fix for hg diff @nnn
Russ Cox [Thu, 8 Sep 2011 14:08:49 +0000 (10:08 -0400)]
codereview: Mercurial 1.9 fix for hg diff @nnn

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

13 years agosync/atomic: add 64-bit Load and Store
Dmitriy Vyukov [Thu, 8 Sep 2011 07:58:48 +0000 (11:58 +0400)]
sync/atomic: add 64-bit Load and Store

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

13 years agoos: os.RemoveAll has to check for 2 error codes on Windows. ENOENT is not enough.
Jaroslavas Počepko [Thu, 8 Sep 2011 07:27:41 +0000 (17:27 +1000)]
os: os.RemoveAll has to check for 2 error codes on Windows. ENOENT is not enough.
os.Lstat can return ENOTDIR as well.

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

13 years agoWindows: net, syscall: implement SetsockoptIPMReq(), move to winsock v2.2 for multica...
Paul Lalonde [Thu, 8 Sep 2011 06:32:40 +0000 (16:32 +1000)]
Windows: net, syscall: implement SetsockoptIPMReq(), move to winsock v2.2 for multicast support.
I don't know the protocol regarding the zsyscall files which appear to
be hand-generated, so I've re-done them and added them to the change.

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

13 years agoA+C: Paul Lalonde (individual CLA).
Nigel Tao [Thu, 8 Sep 2011 06:31:13 +0000 (16:31 +1000)]
A+C: Paul Lalonde (individual CLA).

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

13 years agosync/atomic: do not run TestStoreLoadSeq for too long (fix windows builder)
Alex Brainman [Thu, 8 Sep 2011 03:31:40 +0000 (13:31 +1000)]
sync/atomic: do not run TestStoreLoadSeq for too long (fix windows builder)

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

13 years agotag release.r60
Andrew Gerrand [Thu, 8 Sep 2011 02:54:35 +0000 (12:54 +1000)]
tag release.r60

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

13 years agodoc: release.r60
Andrew Gerrand [Thu, 8 Sep 2011 02:08:07 +0000 (12:08 +1000)]
doc: release.r60

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

13 years agodoc: fix date in weekly snapshot history
Andrew Gerrand [Thu, 8 Sep 2011 00:03:27 +0000 (10:03 +1000)]
doc: fix date in weekly snapshot history

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

13 years agotag weekly.2011-09-07
Andrew Gerrand [Wed, 7 Sep 2011 23:45:47 +0000 (09:45 +1000)]
tag weekly.2011-09-07

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

13 years agoweekly.2011-09-07 weekly.2011-09-07
Andrew Gerrand [Wed, 7 Sep 2011 23:43:35 +0000 (09:43 +1000)]
weekly.2011-09-07

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

13 years agoundo CL 4964067 / 661cb84cc6f0
Robert Griesemer [Wed, 7 Sep 2011 22:19:53 +0000 (15:19 -0700)]
undo CL 4964067 / 661cb84cc6f0

API change. Needs further reflection.

««« original CL description
path/filepath: Simplify Walk interface

The last argument of filepath.Walk was removed, and the Visitor
interface now contains an Error method that is called on errors.

Fixes #2237.

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

»»»

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

13 years agopath/filepath: Simplify Walk interface
Gustavo Niemeyer [Wed, 7 Sep 2011 21:49:48 +0000 (14:49 -0700)]
path/filepath: Simplify Walk interface

The last argument of filepath.Walk was removed, and the Visitor
interface now contains an Error method that is called on errors.

Fixes #2237.

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

13 years agogc: add -p flag to catch import cycles earlier
Russ Cox [Wed, 7 Sep 2011 19:50:21 +0000 (15:50 -0400)]
gc: add -p flag to catch import cycles earlier

The linker would catch them if gc succeeded,
but too often the cycle manifests as making the
current package and the imported copy of itself
appear as different packages, which result in
type signature mismatches that confuse users.

As a crutch, add the -p flag to say 'if you see an
import of this package, give up early'.  Results in
messages like (during gotest in sort):

export_test.go:7: import "sort" while compiling that package (import cycle)
export_test.go:7: import "container/heap": package depends on "sort" (import cycle)

Fixes #2042.

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

13 years agonet: sync CIDRMask code, doc
Russ Cox [Wed, 7 Sep 2011 19:50:07 +0000 (15:50 -0400)]
net: sync CIDRMask code, doc

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

13 years ago5a, 5c, 6a, 6c, 8a, 8c: fix Windows file paths
Hector Chu [Wed, 7 Sep 2011 19:49:56 +0000 (15:49 -0400)]
5a, 5c, 6a, 6c, 8a, 8c: fix Windows file paths

Verified with objdump -W.

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

13 years agoexp/regexp: bug fixes and RE2 tests
Russ Cox [Wed, 7 Sep 2011 19:48:06 +0000 (15:48 -0400)]
exp/regexp: bug fixes and RE2 tests

Also add exp/regexp to build (forgot before).

At this point I am very confident in exp/regexp's
behavior.  It should be usable as a drop-in
replacement for regexp now.

Later CLs could introduce a CompilePOSIX
to get at traditional POSIX ``extended regular expressions''
as in egrep and also an re.MatchLongest method to
change the matching mode to leftmost longest
instead of leftmost first.  On the other hand, I expect
very few people to use either.

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

13 years agonet: ParseCIDR returns IPNet instead of IPMask
Mikio Hara [Wed, 7 Sep 2011 18:01:12 +0000 (14:01 -0400)]
net: ParseCIDR returns IPNet instead of IPMask

Note that this CL will break your existing code which uses
ParseCIDR.

This CL changes ParseCIDR("172.16.253.121/28") to return
the IP address "172.16.253.121", the network implied by the
network number "172.16.253.112" and mask "255.255.255.240".

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

13 years agogc: silence Plan 9 warnings
Lucio De Re [Wed, 7 Sep 2011 17:55:48 +0000 (13:55 -0400)]
gc: silence Plan 9 warnings

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

13 years agosort: use heapsort to bail out quicksort
Ziad Hatahet [Wed, 7 Sep 2011 17:54:33 +0000 (13:54 -0400)]
sort: use heapsort to bail out quicksort

See http://research.swtch.com/2008/01/killing-quicksort.html for more
info.
Fixes #467.

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

13 years agogopprof: regexp fixes
Hector Chu [Wed, 7 Sep 2011 17:53:29 +0000 (13:53 -0400)]
gopprof: regexp fixes

Extract Windows filenames correctly.
Don't remove receivers from method names.

Fixes #2227.

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

13 years agoA+C: Ziad Hatahet (individual CLA)
Russ Cox [Wed, 7 Sep 2011 17:53:05 +0000 (13:53 -0400)]
A+C: Ziad Hatahet (individual CLA)

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

13 years agosync/atomic: add Store functions
Dmitriy Vyukov [Wed, 7 Sep 2011 17:50:51 +0000 (21:50 +0400)]
sync/atomic: add Store functions

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

13 years agoimage/png: check zlib checksum during Decode
Russ Cox [Wed, 7 Sep 2011 17:23:16 +0000 (13:23 -0400)]
image/png: check zlib checksum during Decode

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

13 years agogc: treat DOTMETH like DOT in escape analysis.
Luuk van Dijk [Wed, 7 Sep 2011 17:03:11 +0000 (19:03 +0200)]
gc: treat DOTMETH like DOT in escape analysis.

Fixes #2225

R=rsc, nigeltao, dave
CC=bradfitz, golang-dev, mikioh.mikioh
https://golang.org/cl/4972056

13 years agoweekly.html: remove note about exp/template -> template move.
David Symonds [Wed, 7 Sep 2011 04:10:14 +0000 (14:10 +1000)]
weekly.html: remove note about exp/template -> template move.

It actually occurred with the previous weekly snapshot.

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

13 years agocleanup: gofmt -s -w src misc
Robert Griesemer [Tue, 6 Sep 2011 23:04:55 +0000 (16:04 -0700)]
cleanup: gofmt -s -w src misc

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

13 years agotemplate: slightly simplify the test for assignability of arguments
Rob Pike [Tue, 6 Sep 2011 22:59:21 +0000 (15:59 -0700)]
template: slightly simplify the test for assignability of arguments

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

13 years agotemplate: indirect or dereference function arguments if necessary to match the type...
Rob Pike [Tue, 6 Sep 2011 22:34:38 +0000 (15:34 -0700)]
template: indirect or dereference function arguments if necessary to match the type of the formal.
Fixes #2235

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

13 years agogo/parser: accept corner cases of signature syntax
Robert Griesemer [Tue, 6 Sep 2011 18:48:05 +0000 (11:48 -0700)]
go/parser: accept corner cases of signature syntax

- func f(int,) is a legal signature
- func f(...int,) is a legal signature

Defer checking for correct use of "..." with last
paremeter type to type checker instead of parser.

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

13 years agogofmt: indent multi-line signatures
Robert Griesemer [Tue, 6 Sep 2011 18:27:36 +0000 (11:27 -0700)]
gofmt: indent multi-line signatures

There may be more fine-tuning down the line,
but this CL fixes the most pressing issue at
hand.

Also: gofmt -w src misc

Fixes #1524.

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

13 years agourl: handle ; in ParseQuery
Russ Cox [Tue, 6 Sep 2011 16:24:24 +0000 (12:24 -0400)]
url: handle ; in ParseQuery

Most web frameworks allow ; as a synonym for &,
following a recommendation in some versions of
the HTML specification.  Do the same.

Remove overuse of Split.

Move ParseQuery tests from package http to package url.

Fixes #2210.

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

13 years agogc: unify stack frame layout
Russ Cox [Tue, 6 Sep 2011 14:24:21 +0000 (10:24 -0400)]
gc: unify stack frame layout

allocparams + tempname + compactframe
all knew about how to place stack variables.

Now only compactframe, renamed to allocauto,
does the work.  Until the last minute, each PAUTO
variable is in its own space and has xoffset == 0.

This might break 5g.  I get failures in concurrent
code running under qemu and I can't tell whether
it's 5g's fault or qemu's.  We'll see what the real
ARM builders say.

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

13 years agoos: use GetFileAttributesEx to implement Stat on windows
Alex Brainman [Mon, 5 Sep 2011 23:59:08 +0000 (09:59 +1000)]
os: use GetFileAttributesEx to implement Stat on windows

Fixes #2129.

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

13 years agogc: fix zero-length struct eval
Russ Cox [Mon, 5 Sep 2011 19:31:22 +0000 (15:31 -0400)]
gc: fix zero-length struct eval

Fixes #2232.

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

13 years agoexp/norm: performance improvements of quickSpan
Marcel van Lohuizen [Mon, 5 Sep 2011 17:09:20 +0000 (19:09 +0200)]
exp/norm: performance improvements of quickSpan
- fixed performance bug that could lead to O(n^2) behavior
- performance improvement for ASCII case

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

13 years agoruntime: fix openbsd 386 raisesigpipe
Joel Sing [Mon, 5 Sep 2011 17:05:57 +0000 (13:05 -0400)]
runtime: fix openbsd 386 raisesigpipe

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

13 years agosyscall: update routing message attributes handling, fix typo
Mikio Hara [Mon, 5 Sep 2011 12:11:51 +0000 (08:11 -0400)]
syscall: update routing message attributes handling, fix typo

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

13 years agobuild: clear execute bit from Go files
Mike Rosset [Mon, 5 Sep 2011 11:48:42 +0000 (07:48 -0400)]
build: clear execute bit from Go files

R=golang-dev, rsc
CC=golang-dev, mike.rosset
https://golang.org/cl/4950062

13 years agoruntime: add test for multiple concurrent channel consumers
Christopher Wedgwood [Mon, 5 Sep 2011 11:40:50 +0000 (07:40 -0400)]
runtime: add test for multiple concurrent channel consumers

There was a time (in the past) when this wasn't robust.

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

13 years agomisc/goplay: another template fix
Andrew Gerrand [Mon, 5 Sep 2011 05:03:41 +0000 (15:03 +1000)]
misc/goplay: another template fix

Fixes #2219.

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

13 years agogobuilder: ignore _test.go files when looking for docs, more logging
Andrew Gerrand [Mon, 5 Sep 2011 04:48:27 +0000 (14:48 +1000)]
gobuilder: ignore _test.go files when looking for docs, more logging

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

13 years agowebsocket: fix incorrect prints found by govet
Robert Hencke [Mon, 5 Sep 2011 00:56:39 +0000 (10:56 +1000)]
websocket: fix incorrect prints found by govet

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

13 years agomisc/goplay: Fix template output
Andrew Gerrand [Sun, 4 Sep 2011 23:50:22 +0000 (09:50 +1000)]
misc/goplay: Fix template output

Fixes #2219.

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

13 years agogofix: do not convert url in field names
Gustavo Niemeyer [Sat, 3 Sep 2011 19:01:54 +0000 (16:01 -0300)]
gofix: do not convert url in field names

There's some ambiguity in the U{url: url} case as it could be
both a map or a struct literal, but given context it's more
likely a struct, so U{url: url_} rather than U{url_: url_}.
At least that was the case for me.

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

13 years agoruntime: implement exception handling on windows/amd64
Hector Chu [Sat, 3 Sep 2011 08:27:16 +0000 (18:27 +1000)]
runtime: implement exception handling on windows/amd64

Fixes #2194.

R=rsc, alex.brainman, vcc.163, jp
CC=golang-dev
https://golang.org/cl/4977044

13 years agoexp/template/html: string replacement refactoring.
Nigel Tao [Sat, 3 Sep 2011 00:30:05 +0000 (10:30 +1000)]
exp/template/html: string replacement refactoring.

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

13 years agogc: introduce temp = nod+tempname
Russ Cox [Fri, 2 Sep 2011 19:35:16 +0000 (15:35 -0400)]
gc: introduce temp = nod+tempname

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

13 years agogc: zero stack-allocated slice backing arrays
Russ Cox [Fri, 2 Sep 2011 19:11:28 +0000 (15:11 -0400)]
gc: zero stack-allocated slice backing arrays

Fixes Han-Wen's termite bug.

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

13 years agogodoc: minor tweaks for app-engine use
Robert Griesemer [Fri, 2 Sep 2011 17:07:29 +0000 (10:07 -0700)]
godoc: minor tweaks for app-engine use

- read search index files in groutine to avoid
  start-up failure on app engine because reading
  the files takes too long
- permit usage of search index files and indexer
- minor cosmetic cleanups

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

13 years agoexp/norm: added Reader and Writer and bug fixes to support these.
Marcel van Lohuizen [Fri, 2 Sep 2011 10:39:35 +0000 (12:39 +0200)]
exp/norm: added Reader and Writer and bug fixes to support these.
Needed to ensure that finding the last boundary does not result in O(n^2)-like behavior.
Now prevents lookbacks beyond 31 characters across the board (starter + 30 non-starters).
composition.go:
- maxCombiningCharacters now means exactly that.
- Bug fix.
- Small performance improvement/ made code consistent with other code.
forminfo.go:
- Bug fix: ccc needs to be 0 for inert runes.
normalize.go:
- A few bug fixes.
- Limit the amount of combining characters considered in FirstBoundary.
- Ditto for LastBoundary.
- Changed semantics of LastBoundary to not consider trailing illegal runes a boundary
  as long as adding bytes might still make them legal.
trie.go:
- As utf8.UTFMax is 4, we should treat UTF-8 encodings of size 5 or greater as illegal.
  This has no impact on the normalization process, but it prevents buffer overflows
  where we expect at most UTFMax bytes.

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

13 years agofmt/fmt_test.go: count mallocs in a few more cases.
Rob Pike [Fri, 2 Sep 2011 01:47:15 +0000 (11:47 +1000)]
fmt/fmt_test.go: count mallocs in a few more cases.
Interesting that Fprintf can do zero mallocs.
(Sprintf must allocate the returned string.)

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

13 years agotemplate: fix deadlock.
Rob Pike [Fri, 2 Sep 2011 01:00:46 +0000 (11:00 +1000)]
template: fix deadlock.
No need for lexInsideAction to loop.
Fixes #2217.

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