Commit c9b66bb3 authored by Dan Peterson's avatar Dan Peterson Committed by Brad Fitzpatrick

io: document WriteString calls Write exactly once

Fixes #13849

Change-Id: Idd7f06b547a0179fe15571807a8c48b7c3b78d7c
Reviewed-on: https://go-review.googlesource.com/21852Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 1f54410a
......@@ -291,6 +291,7 @@ type stringWriter interface {
// WriteString writes the contents of the string s to w, which accepts a slice of bytes.
// If w implements a WriteString method, it is invoked directly.
// Otherwise, w.Write is called exactly once.
func WriteString(w Writer, s string) (n int, err error) {
if sw, ok := w.(stringWriter); ok {
return sw.WriteString(s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment