diff options
author | David Symonds <dsymonds@golang.org> | 2009-06-24 19:02:29 -0700 |
---|---|---|
committer | David Symonds <dsymonds@golang.org> | 2009-06-24 19:02:29 -0700 |
commit | e3fe6186634f9b74b9f39924516e24b068b9e141 (patch) | |
tree | c423ba821d41ea2d673a7420ecf7c082aa827863 /src/pkg/strconv | |
parent | c9af30256dfa40f26f2a60e88b68dadfbabdd2ba (diff) | |
download | golang-e3fe6186634f9b74b9f39924516e24b068b9e141.tar.gz |
Change strings.Split, bytes.Split to take a maximum substring count argument.
R=rsc
APPROVED=r
DELTA=131 (39 added, 10 deleted, 82 changed)
OCL=30669
CL=30723
Diffstat (limited to 'src/pkg/strconv')
-rw-r--r-- | src/pkg/strconv/fp_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/strconv/fp_test.go b/src/pkg/strconv/fp_test.go index f1993bb7e..20e158cec 100644 --- a/src/pkg/strconv/fp_test.go +++ b/src/pkg/strconv/fp_test.go @@ -28,7 +28,7 @@ func pow2(i int) float64 { // Wrapper around strconv.Atof64. Handles dddddp+ddd (binary exponent) // itself, passes the rest on to strconv.Atof64. func myatof64(s string) (f float64, ok bool) { - a := strings.Split(s, "p"); + a := strings.Split(s, "p", 2); if len(a) == 2 { n, err := strconv.Atoi64(a[0]); if err != nil { @@ -72,7 +72,7 @@ func myatof64(s string) (f float64, ok bool) { // Wrapper around strconv.Atof32. Handles dddddp+ddd (binary exponent) // itself, passes the rest on to strconv.Atof32. func myatof32(s string) (f float32, ok bool) { - a := strings.Split(s, "p"); + a := strings.Split(s, "p", 2); if len(a) == 2 { n, err := strconv.Atoi(a[0]); if err != nil { @@ -115,7 +115,7 @@ func TestFp(t *testing.T) { if len(line) == 0 || line[0] == '#' { continue } - a := strings.Split(line, " "); + a := strings.Split(line, " ", 0); if len(a) != 4 { t.Error("testfp.txt:", lineno, ": wrong field count\n"); continue; |