summaryrefslogtreecommitdiff
path: root/src/pkg/fmt
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-05-27 14:51:47 -0700
committerRuss Cox <rsc@golang.org>2010-05-27 14:51:47 -0700
commit72aaa4ca27df8cf19707c1b5b4795be22dbe2260 (patch)
tree0a1979ffe528bfde23ecdc7ef0339d7d0a7d1a80 /src/pkg/fmt
parent9ead4aa791e9113b87c9ddbde498290d1e5e4b22 (diff)
downloadgolang-72aaa4ca27df8cf19707c1b5b4795be22dbe2260.tar.gz
changes &x -> x[0:] for array to slice conversion
R=gri CC=golang-dev http://codereview.appspot.com/1326042
Diffstat (limited to 'src/pkg/fmt')
-rw-r--r--src/pkg/fmt/format.go2
-rw-r--r--src/pkg/fmt/print.go2
-rw-r--r--src/pkg/fmt/scan.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/fmt/format.go b/src/pkg/fmt/format.go
index 2637eb4cd..c7a67d3bd 100644
--- a/src/pkg/fmt/format.go
+++ b/src/pkg/fmt/format.go
@@ -168,7 +168,7 @@ func (f *fmt) fmt_boolean(v bool) {
// integer; interprets prec but not wid. Once formatted, result is sent to pad()
// and then flags are cleared.
func (f *fmt) integer(a int64, base uint64, signedness bool, digits string) {
- var buf []byte = &f.intbuf
+ var buf []byte = f.intbuf[0:]
negative := signedness == signed && a < 0
if negative {
a = -a
diff --git a/src/pkg/fmt/print.go b/src/pkg/fmt/print.go
index e4413efa4..9c1940599 100644
--- a/src/pkg/fmt/print.go
+++ b/src/pkg/fmt/print.go
@@ -201,7 +201,7 @@ func (p *pp) add(c int) {
if c < utf8.RuneSelf {
p.buf.WriteByte(byte(c))
} else {
- w := utf8.EncodeRune(c, &p.runeBuf)
+ w := utf8.EncodeRune(c, p.runeBuf[0:])
p.buf.Write(p.runeBuf[0:w])
}
}
diff --git a/src/pkg/fmt/scan.go b/src/pkg/fmt/scan.go
index b082399fa..0c9ed4d76 100644
--- a/src/pkg/fmt/scan.go
+++ b/src/pkg/fmt/scan.go
@@ -95,7 +95,7 @@ func (r readRune) ReadRune() (rune int, size int, err os.Error) {
if err != nil {
break
}
- if !utf8.FullRune(&r.buf) {
+ if !utf8.FullRune(r.buf[0:]) {
continue
}
if c, w := utf8.DecodeRune(r.buf[0:size]); w == size {