1
0
mirror of https://github.com/golang/go synced 2024-11-21 13:24:40 -07:00
The Go programming language
Go to file
Rob Pike d482c163be fmt.Print*: reimplement to switch on type first.
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
2010-06-14 17:16:35 -07:00
doc tutorial: update discussion of variadic functions 2010-06-14 12:27:22 -07:00
include Fix *l/*c -V flag segfault 2010-02-08 11:53:27 -08:00
lib codereview: avoid exception in match 2010-06-09 21:37:11 -07:00
misc godashboard: change behaviour of top button 2010-05-25 14:22:12 -07:00
pkg more description 2009-10-15 23:08:46 -07:00
src fmt.Print*: reimplement to switch on type first. 2010-06-14 17:16:35 -07:00
test fmt.Print*: reimplement to switch on type first. 2010-06-14 17:16:35 -07:00
.hgignore .hgignore: ignore doc/htmlgen 2010-06-09 21:39:40 -07:00
.hgtags release.2010-06-09 tag 2010-06-09 23:13:01 +02:00
AUTHORS A+C: James Whitehead and Paolo Giarrusso (both individual CLA) 2010-06-09 21:25:13 -07:00
CONTRIBUTORS A+C: James Whitehead and Paolo Giarrusso (both individual CLA) 2010-06-09 21:25:13 -07:00
favicon.ico add a favicon plus a couple of hi-res versions of gordon 2009-10-26 10:13:07 -07:00
LICENSE Add an explicit patent grant to the Go license. 2010-01-25 15:39:32 -08:00
README add a README file, so that if someone finds a 2009-11-08 09:57:37 -08: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.