1. 15 Jun, 2010 3 commits
    • Russ Cox's avatar
      c9172fb2
    • Rob Pike's avatar
      fmt.Printf: write tests for %T. · 177746ba
      Rob Pike authored
      Fix a bug that caused it to ignore field widths.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/1704041
      177746ba
    • Rob Pike's avatar
      fmt.Print*: reimplement to switch on type first. · d482c163
      Rob Pike authored
      This shortens, simplifies and regularizes the code significantly.
      (Improvements to reflect could make another step.)
      Passes all.bash.
      
      One semantic change occurs: The String() method changes
      behavior. It used to run only for string formats such as %s and %q.
      Instead, it now runs whenever the item has the method and the
      result is then processed by the format as a string. Besides the
      regularization, this has three effects:
      
      	1) width is honored for String() items
      	2) %x works for String() items
      	3) implementations of String that merely recur will recur forever
      
      Regarding point 3, example from the updated documentation:
      	type X int
      	func (x X) String() string { return Sprintf("%d", x) }
      should cast the value before recurring:
      	func (x X) String() string { return Sprintf("%d", int(x)) }
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/1613045
      d482c163
  2. 14 Jun, 2010 7 commits
  3. 12 Jun, 2010 5 commits
  4. 11 Jun, 2010 6 commits
  5. 10 Jun, 2010 6 commits
  6. 09 Jun, 2010 12 commits
  7. 08 Jun, 2010 1 commit