Skip to content

Commit c9b66bb

Browse files
danpbradfitz
authored andcommitted
io: document WriteString calls Write exactly once
Fixes #13849 Change-Id: Idd7f06b547a0179fe15571807a8c48b7c3b78d7c Reviewed-on: https://go-review.googlesource.com/21852 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 1f54410 commit c9b66bb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/io/io.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ type stringWriter interface {
291291

292292
// WriteString writes the contents of the string s to w, which accepts a slice of bytes.
293293
// If w implements a WriteString method, it is invoked directly.
294+
// Otherwise, w.Write is called exactly once.
294295
func WriteString(w Writer, s string) (n int, err error) {
295296
if sw, ok := w.(stringWriter); ok {
296297
return sw.WriteString(s)

0 commit comments

Comments
 (0)