The Go programming language
Go to file
Gustavo Niemeyer e3df71f50b 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
2011-08-15 00:56:01 -03:00
doc weekly.2011-08-10 2011-08-10 16:00:22 +10:00
include build: define getcallerpc in u.h (fix for Plan 9 build) 2011-07-25 13:45:44 -04:00
lib godoc: fix godoc.html template bug: correctly display package roots 2011-08-14 08:56:47 +10:00
misc misc/vim: Godoc command. 2011-08-03 16:46:35 +10:00
src exp/template: support field syntax on maps 2011-08-15 00:56:01 -03:00
test timing.log: significant improvements after custom algorithms 2011-08-10 15:45:37 +10:00
.hgignore exp/norm: added trie lookup code and associated tests. 2011-08-10 15:34:12 +02:00
.hgtags tag weekly.2011-08-10 2011-08-10 16:05:31 +10:00
AUTHORS A+C: Dave Grijalva (ngmoco CLA) 2011-08-10 14:05:52 -07:00
CONTRIBUTORS C: add Sugu Sougoumarane, Googler. 2011-08-14 09:35:01 +10:00
favicon.ico add a favicon plus a couple of hi-res versions of gordon 2009-10-26 10:13:07 -07:00
LICENSE LICENSE: separate, change PATENTS text 2010-12-06 16:31:59 -05:00
PATENTS LICENSE: separate, change PATENTS text 2010-12-06 16:31:59 -05:00
README build: update, streamline documentation for new $GOBIN 2010-08-24 20:00:50 -04:00
robots.txt godoc: serve robots.txt raw 2011-02-19 05:46:20 +11:00

This is the source code repository for the Go programming language.  

For documentation about how to install and use Go,
visit http://golang.org/ or load doc/install.html in your web browser.

After installing Go, you can view a nicely formatted
doc/install.html by running godoc --http=:6060
and then visiting http://localhost:6060/doc/install.html.

Unless otherwise noted, the Go source files are distributed
under the BSD-style license found in the LICENSE file.

--

Binary Distribution Notes

If you have just untarred a binary Go distribution, you need to set
the environment variable $GOROOT to the full path of the go
directory (the one containing this README).  You can omit the
variable if you unpack it into /usr/local/go, or if you rebuild
from sources by running all.bash (see doc/install.html).
You should also add the Go binary directory $GOROOT/bin
to your shell's path.

For example, if you extracted the tar file into $HOME/go, you might
put the following in your .profile:

    export GOROOT=$HOME/go
    export PATH=$PATH:$GOROOT/bin

See doc/install.html for more details.