summaryrefslogtreecommitdiff
path: root/src/lib/fmt/format.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-11-25 09:23:13 -0800
committerRuss Cox <rsc@golang.org>2008-11-25 09:23:13 -0800
commitc2bc9b1490f473959869c337c53d253709fe0b59 (patch)
tree6404db750b0739f17a7d8ca4c7790448a231826f /src/lib/fmt/format.go
parentcee312230dfe073d6b5e8bbd3ad4fa4c3554609a (diff)
downloadgolang-c2bc9b1490f473959869c337c53d253709fe0b59.tar.gz
% x inserts spaces between hex bytes in string/*[]byte
R=r DELTA=7 (7 added, 0 deleted, 0 changed) OCL=19967 CL=19978
Diffstat (limited to 'src/lib/fmt/format.go')
-rw-r--r--src/lib/fmt/format.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/fmt/format.go b/src/lib/fmt/format.go
index 64d6c9bc9..d1c20a513 100644
--- a/src/lib/fmt/format.go
+++ b/src/lib/fmt/format.go
@@ -374,6 +374,9 @@ func (f *Fmt) s(s string) *Fmt {
func (f *Fmt) sx(s string) *Fmt {
t := "";
for i := 0; i < len(s); i++ {
+ if i > 0 && f.space {
+ t += " ";
+ }
v := s[i];
t += string(ldigits[v>>4]);
t += string(ldigits[v&0xF]);