aboutsummaryrefslogtreecommitdiff
path: root/src/lib/fmt
AgeCommit message (Collapse)Author
2008-11-17correctly rounded floating-point conversionsRuss Cox
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 Pike
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 Pike
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 Griesemer
R=r OCL=18685 CL=18685
2008-11-06If a value implements String(), use that in fmt.print (not fmt.printf)Rob Pike
R=rsc DELTA=13 (9 added, 0 deleted, 4 changed) OCL=18682 CL=18684
2008-11-06Polymorphic printing.Rob Pike
R=rsc DELTA=100 (70 added, 10 deleted, 20 changed) OCL=18663 CL=18669
2008-11-04prepare for recursive printfsRob Pike
R=rsc DELTA=31 (9 added, 6 deleted, 16 changed) OCL=18470 CL=18472
2008-11-02printf as we know and love it.Rob Pike
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 Pike
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 Pike
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 Cox
R=r DELTA=202 (60 added, 24 deleted, 118 changed) OCL=18029 CL=18038
2008-10-29adapt to new compiler typesRuss Cox
R=r OCL=18024 CL=18024
2008-10-26fix top-level commentsRob Pike
R=rsc DELTA=14 (13 added, 0 deleted, 1 changed) OCL=17858 CL=17867
2008-10-24add printf to fmt.Rob Pike
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
2008-10-24make fmt a directoryRob Pike
some build dependencies need rearrangement because fmt will depend on reflect R=rsc DELTA=1091 (567 added, 521 deleted, 3 changed) OCL=17792 CL=17796