summaryrefslogtreecommitdiff
path: root/src/lib/fmt/print.go
AgeCommit message (Collapse)AuthorFilesLines
2009-06-09mv src/lib to src/pkgRob Pike1-705/+0
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102
2009-05-11change utf8.FullRuneInString and utf8.DecodeRuneInStringRuss Cox1-2/+2
to use single string argument instead of string, index. R=r DELTA=136 (9 added, 7 deleted, 120 changed) OCL=28642 CL=28644
2009-05-08Name change to improve embeddability:Rob Pike1-7/+7
io.Read->io.Reader io.Write,Close,etc.->io.Writer,Closer etc. R=rsc DELTA=190 (0 added, 0 deleted, 190 changed) OCL=28525 CL=28535
2009-04-17Step 1 of the Big Error Shift: make os.Error an interface and replace ↵Rob Pike1-8/+8
*os.Errors with os.Errors. lib/template updated to use new setup; its clients also updated. Step 2 will make os's error support internally much cleaner. R=rsc OCL=27586 CL=27586
2009-04-16Convert go tree to hierarchical pkg directory:Russ Cox1-1/+1
import ( "vector" -> "container/vector" "ast" -> "go/ast" "sha1" -> "hash/sha1" etc. ) and update Makefiles. Because I did the conversion semi-automatically, I sorted all the import blocks as a post-processing. Some files have therefore changed that didn't strictly need to. Rename local packages to lower case. The upper/lower distinction doesn't work on OS X and complicates the "single-package directories with the same package name as directory name" heuristic used by gobuild and godoc to create the correlation between source and binary locations. Now that we have a plan to avoid globally unique names, the upper/lower is unnecessary. The renamings will cause trouble for a few users, but so will the change in import paths. This way, the two maintenance fixes are rolled into one inconvenience. R=r OCL=27573 CL=27575
2009-04-06add method Value() Value to InterfaceValue.Russ Cox1-4/+3
use Value() in print to print underlying value from interface. before: package main import "fmt" func main() { x := []interface{} {1, "hello", 2.5}; fmt.Println(x[0], x[1], x[2], x); } 1 hello 2.5 [<non-nil interface> <non-nil interface> <non-nil interface>] after: 1 hello 2.5 [1 hello 2.5] R=r DELTA=44 (22 added, 16 deleted, 6 changed) OCL=27139 CL=27141
2009-03-09delete float80 from librariesRob Pike1-3/+1
R=rsc DELTA=40 (0 added, 38 deleted, 2 changed) OCL=25969 CL=25969
2009-03-06document fmt.Rob Pike1-11/+51
the description of the format verbs still needs to be done. R=rsc DELTA=288 (88 added, 12 deleted, 188 changed) OCL=25814 CL=25833
2009-01-27change dotdotdot interfaces to be structs,Russ Cox1-6/+6
not pointers to structs. fix defered dotdotdot. R=r,ken DELTA=25 (7 added, 5 deleted, 13 changed) OCL=23620 CL=23625
2009-01-20delete exportRuss Cox1-12/+12
TBR=r OCL=23121 CL=23127
2009-01-16casify, cleanup sysRuss Cox1-2/+3
R=r OCL=22978 CL=22984
2009-01-16two more casifications in fmtRob Pike1-7/+7
R=rsc DELTA=14 (0 added, 0 deleted, 14 changed) OCL=22960 CL=22962
2009-01-15casify fmt and its dependents.Rob Pike1-56/+56
R=rsc DELTA=224 (0 added, 2 deleted, 222 changed) OCL=22875 CL=22875
2009-01-15printf->Printf etc.Rob Pike1-12/+12
the raw fmt routines will be another, smaller but subtler pass. R=rsc DELTA=157 (0 added, 0 deleted, 157 changed) OCL=22851 CL=22851
2009-01-06new new & makeRuss Cox1-2/+2
R=r OCL=22166 CL=22166
2008-12-22print array (not just *array) using %vRob Pike1-1/+20
TBR=rsc DELTA=34 (33 added, 0 deleted, 1 changed) OCL=21718 CL=21718
2008-12-19[] and struct in interfaces.Russ Cox1-4/+3
other [] cleanup. convert() is gone. R=r DELTA=352 (144 added, 68 deleted, 140 changed) OCL=21660 CL=21662
2008-12-19fmt and reflect updates for recent changesRuss Cox1-4/+6
TBR=r OCL=21580 CL=21583
2008-12-18convert *[] to [].Russ Cox1-10/+7
R=r OCL=21563 CL=21571
2008-12-16clear flags so that %+v does not pass the +Russ Cox1-1/+2
to the first field it prints. R=r DELTA=2 (1 added, 0 deleted, 1 changed) OCL=21324 CL=21328
2008-12-11print field names on struct members.Russ Cox1-17/+40
also don't concatenate strings next to each other in the struct, like p.doprint does. expose additional print flags to formatters R=r DELTA=128 (111 added, 11 deleted, 6 changed) OCL=20991 CL=21018
2008-12-11add uintptr to reflect and printRob Pike1-2/+7
R=rsc DELTA=70 (35 added, 4 deleted, 31 changed) OCL=20993 CL=20998
2008-12-11handle the nil interface better in reflect and printRob Pike1-5/+17
R=rsc DELTA=25 (19 added, 0 deleted, 6 changed) OCL=20985 CL=20985
2008-12-10assorted cleanup and fixesRuss Cox1-1/+1
R=r DELTA=209 (109 added, 79 deleted, 21 changed) OCL=20930 CL=20934
2008-12-09fix historical editing glitchRob Pike1-1/+1
R=rsc DELTA=1 (0 added, 0 deleted, 1 changed) OCL=20871 CL=20873
2008-12-09use unsafe.pointer in reflection objectsRob Pike1-4/+4
R=rsc DELTA=326 (4 added, 259 deleted, 63 changed) OCL=20853 CL=20856
2008-11-24replay CL 19916 and CL 19913 now that the build can handle themRuss Cox1-12/+60
TBR=r OCL=19924 CL=19934
2008-11-24Automated g4 rollback of changelist 19916.Russ Cox1-60/+12
*** Reason for rollback *** broke build *** Original change description *** utf8: add InString routines for decoding in strings reflect: add InterfaceValue.Get(), remove Empty strconv: add Quote, CanBackquote fmt: * %q go-quoted " string * %#q go-quoted ` string if possible, " string otherwise * %x hexadecimal string * anywhere a string is okay, *[]byte is okay * flags # 0 - + space * print value inside interface, not interface itself * tests TBR=r OCL=19920 CL=19920
2008-11-24utf8: add InString routines for decoding in stringsRuss Cox1-12/+60
reflect: add InterfaceValue.Get(), remove Empty strconv: add Quote, CanBackquote fmt: * %q go-quoted " string * %#q go-quoted ` string if possible, " string otherwise * %x hexadecimal string * anywhere a string is okay, *[]byte is okay * flags # 0 - + space * print value inside interface, not interface itself * tests R=r DELTA=756 (597 added, 121 deleted, 38 changed) OCL=19888 CL=19916
2008-11-17correctly rounded floating-point conversionsRuss Cox1-9/+42
in new package strconv. move atoi etc to strconv too. update fmt, etc to use strconv. R=r DELTA=2232 (1691 added, 424 deleted, 117 changed) OCL=19286 CL=19380
2008-11-14handle nils safelyRob Pike1-22/+26
R=rsc DELTA=38 (14 added, 10 deleted, 14 changed) OCL=19242 CL=19242
2008-11-13add a %v format to print an arbitrary value in its "println" form.Rob Pike1-38/+75
also add code to print (pointers to) arrays, through %v. R=rsc DELTA=108 (70 added, 33 deleted, 5 changed) OCL=19184 CL=19192
2008-11-06- fixes to sprintf (by rob)Robert Griesemer1-8/+11
R=r OCL=18685 CL=18685
2008-11-06If a value implements String(), use that in fmt.print (not fmt.printf)Rob Pike1-4/+13
R=rsc DELTA=13 (9 added, 0 deleted, 4 changed) OCL=18682 CL=18684
2008-11-06Polymorphic printing.Rob Pike1-29/+89
R=rsc DELTA=100 (70 added, 10 deleted, 20 changed) OCL=18663 CL=18669
2008-11-04prepare for recursive printfsRob Pike1-22/+25
R=rsc DELTA=31 (9 added, 6 deleted, 16 changed) OCL=18470 CL=18472
2008-11-02printf as we know and love it.Rob Pike1-21/+25
Plus print[ln] with the ability to print struct values. Note for language mavens: if a "..." function passes its argument to another "..." function, the argument is not wrapped again. This allows printf to call fprintf without extra manipulation. It's good but needs to go in the spec. This code works: /// package main import fmt "fmt" import os "os" type T struct { s string; a, b int } func main() { P := fmt.Printer(); P.printf("%s = %d with float value %.4f\n", "hi there", 7, 123.456); P.println("hi there", 7, 123.456); P.fprintf(os.Stdout, "%s = %d with float value %.4f\n", "hi there", 7, 123.456); P.println(T{"x", 7, 234}, "end of struct", 8, 9); } R=rsc DELTA=28 (7 added, 3 deleted, 18 changed) OCL=18321 CL=18324
2008-11-01a couple of bugs in print.Rob Pike1-1/+11
1) bool wasn't handled (added '%t' for 'truth'). 2) float64 had a typo. TBR=rsc DELTA=11 (10 added, 0 deleted, 1 changed) OCL=18314 CL=18318
2008-10-29update fmt to int/int32 etc splitRob Pike1-3/+9
R=rsc DELTA=9 (6 added, 0 deleted, 3 changed) OCL=18072 CL=18075
2008-10-29update Fmt interface: d=int, ud=uint, d32=int32, d64=int64, etc.Russ Cox1-15/+15
R=r DELTA=202 (60 added, 24 deleted, 118 changed) OCL=18029 CL=18038
2008-10-26fix top-level commentsRob Pike1-0/+5
R=rsc DELTA=14 (13 added, 0 deleted, 1 changed) OCL=17858 CL=17867
2008-10-24add printf to fmt.Rob Pike1-0/+387
uses reflection to determine arguments. for now, the arguments must be provided as a struct; the compiler will soon do the packaging automatically for "..." parameters. R=rsc DELTA=1436 (909 added, 520 deleted, 7 changed) OCL=17823 CL=17831