- 15 Aug, 2011 4 commits
-
-
Gustavo Niemeyer authored
Fixes #2152. R=golang-dev, dvyukov CC=golang-dev https://golang.org/cl/4888044
-
Rob Pike authored
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
-
Gustavo Niemeyer authored
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
-
Gustavo Niemeyer authored
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
-
- 14 Aug, 2011 2 commits
-
-
Robert Hencke authored
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4895042
-
Andrew Gerrand authored
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4875048
-
- 13 Aug, 2011 3 commits
-
-
Rob Pike authored
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4901041
-
Andrew Gerrand authored
R=golang-dev, r CC=golang-dev https://golang.org/cl/4898042
-
David Symonds authored
R=r, rsc CC=golang-dev https://golang.org/cl/4873046
-
- 12 Aug, 2011 12 commits
-
-
Robert Griesemer authored
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
-
Robert Griesemer authored
- 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
-
Robert Griesemer authored
- 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
-
Marcel van Lohuizen authored
R=r, r CC=golang-dev https://golang.org/cl/4837071
-
Marcel van Lohuizen authored
R=r, r CC=golang-dev https://golang.org/cl/4837071
-
Mikio Hara authored
R=gri, dsymonds CC=golang-dev https://golang.org/cl/4881042
-
Joel Sing authored
R=golang-dev, r CC=golang-dev https://golang.org/cl/4837048
-
Mike Samuel authored
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
-
Rob Pike authored
R=golang-dev, dsymonds CC=golang-dev, mikesamuel https://golang.org/cl/4875042
-
David Symonds authored
R=r CC=golang-dev https://golang.org/cl/4878042
-
Rob Pike authored
How quaint. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4874045
-
Rob Pike authored
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4868045
-
- 11 Aug, 2011 7 commits
-
-
Robert Griesemer authored
- 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
-
Nigel Tao authored
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
-
Rob Pike authored
Also simplify nil handling in printing. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4869042
-
Gustavo Niemeyer authored
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
-
Alex Brainman authored
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4859042
-
Russ Cox authored
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
-
Russ Cox authored
R=bradfitz, dsymonds, fshahriar CC=golang-dev https://golang.org/cl/4859043
-
- 10 Aug, 2011 12 commits
-
-
Rob Pike authored
Also protect against invalid (zero Value) reflect.Values. R=rsc, gri CC=golang-dev https://golang.org/cl/4810094
-
Dave Grijalva authored
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
-
Brad Fitzpatrick authored
R=rsc CC=golang-dev https://golang.org/cl/4855051
-
Brad Fitzpatrick authored
Addresses part of issue 2093 Thanks to espians....@ R=golang-dev, nigeltao CC=golang-dev https://golang.org/cl/4808087
-
Marcel van Lohuizen authored
- 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
-
Marcel van Lohuizen authored
- 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
-
Russ Cox authored
Now that reflect has v.Addr(), we can use it. R=golang-dev, dsymonds, r CC=golang-dev https://golang.org/cl/4860041
-
Rob Pike authored
the format string does not specify its presence. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4839059
-
Alex Brainman authored
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
-
Nigel Tao authored
R=r CC=golang-dev https://golang.org/cl/4808088
-
Nigel Tao authored
R=r CC=golang-dev https://golang.org/cl/4830069
-
Rob Pike authored
See https://golang.org/cl/4815087 R=golang-dev, nigeltao CC=golang-dev https://golang.org/cl/4849050
-