summaryrefslogtreecommitdiff
path: root/test/const3.go
AgeCommit message (Collapse)AuthorFilesLines
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-0/+6
2010-06-14fmt.Print*: reimplement to switch on type first.Rob Pike1-1/+1
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 http://codereview.appspot.com/1613045
2010-03-24delete all uses of panicln by rewriting them using panic or,Rob Pike1-10/+10
in the tests, println+panic. gofmt some tests too. R=rsc CC=golang-dev http://codereview.appspot.com/741041
2009-03-12make 6g constants behave as ken proposes. (i hope.)Russ Cox1-0/+29
various bug fixes and tests involving constants. test/const1.go is the major new test case. R=ken OCL=26216 CL=26224