From 4c9d84f06a2a7aa5978c62636519e6e2bec14112 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 4 Sep 2008 10:39:04 -0700 Subject: [PATCH] Update fmt, refl, and rpc to exploit bug fixes in compiler R=gri OCL=14806 CL=14806 --- src/lib/fmt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/fmt.go b/src/lib/fmt.go index d68d9dbf23..9099a16306 100644 --- a/src/lib/fmt.go +++ b/src/lib/fmt.go @@ -112,14 +112,14 @@ func (f *Fmt) pad(s string) { if w > NByte { w = NByte; } - var buf[NByte] byte; // BUG: should be able to allocate variable size + buf := new([]byte, w); for i := 0; i < w; i++ { buf[i] = ' '; } if left { - s = string(buf)[0:w] + s; + s = string(buf) + s; } else { - s = s + string(buf)[0:w]; + s = s + string(buf); } } } -- 2.48.1