1. 15 Aug, 2011 3 commits
    • Rob Pike's avatar
      old/template: copy code from template · d7440ce2
      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
      d7440ce2
    • Gustavo Niemeyer's avatar
      exp/template: support field syntax on maps · e3df71f5
      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
      e3df71f5
    • Gustavo Niemeyer's avatar
      exp/template: don't panic on range of nil interface · e3f3a541
      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
      e3f3a541
  2. 14 Aug, 2011 2 commits
  3. 13 Aug, 2011 3 commits
  4. 12 Aug, 2011 12 commits
  5. 11 Aug, 2011 7 commits
  6. 10 Aug, 2011 13 commits