aboutsummaryrefslogtreecommitdiff
path: root/src/fmt/errors.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2019-05-08 18:47:32 -0400
committerRuss Cox <rsc@golang.org>2019-05-09 17:49:12 +0000
commit50a1d89ab2b193e7583da32be551e6074e1e7f9a (patch)
tree89253269fd55e36cd39896ce5f8d258df92d0295 /src/fmt/errors.go
parenta44c3edbe0aafb509a175dfe0918bd17863bc97c (diff)
downloadgo-50a1d89ab2b193e7583da32be551e6074e1e7f9a.tar.xz
fmt: rename buffer.WriteByte to writeByte
Renaming the method makes clear, both to readers and to vet, that this method is not the implementation of io.ByteWriter. Working toward making the tree vet-safe instead of having so many exceptions in cmd/vet/all/whitelist. For #31916. Change-Id: I79da062ca6469b62a6b9e284c6cf2413c7425249 Reviewed-on: https://go-review.googlesource.com/c/go/+/176109 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/fmt/errors.go')
-rw-r--r--src/fmt/errors.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fmt/errors.go b/src/fmt/errors.go
index 06416425c3..4dcd01bdc4 100644
--- a/src/fmt/errors.go
+++ b/src/fmt/errors.go
@@ -156,10 +156,10 @@ loop:
break
}
if w.fmt.needColon || !p.fmt.plusV {
- w.buf.WriteByte(':')
+ w.buf.writeByte(':')
w.fmt.needColon = false
}
- w.buf.WriteString(sep)
+ w.buf.writeString(sep)
w.fmt.inDetail = false
w.fmt.needNewline = false
}
@@ -195,24 +195,24 @@ func (p *errPPState) Write(b []byte) (n int, err error) {
for i, c := range b {
if p.fmt.needNewline {
if p.fmt.inDetail && p.fmt.needColon {
- p.buf.WriteByte(':')
+ p.buf.writeByte(':')
p.fmt.needColon = false
}
- p.buf.Write(detailSep)
+ p.buf.write(detailSep)
p.fmt.needNewline = false
}
if c == '\n' {
- p.buf.Write(b[k:i])
+ p.buf.write(b[k:i])
k = i + 1
p.fmt.needNewline = true
}
}
- p.buf.Write(b[k:])
+ p.buf.write(b[k:])
if !p.fmt.inDetail {
p.fmt.needColon = true
}
} else if !p.fmt.inDetail {
- p.buf.Write(b)
+ p.buf.write(b)
}
return len(b), nil