Documentation
¶
Overview ¶
Package bytes aids in manipulating byte slices and writing bytes and strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type StringWriter ¶
type StringWriter interface { Write([]byte) (int, error) WriteByte(byte) error WriteRune(r rune) (int, error) WriteString(s string) (int, error) }
StringWriter defines an abstract set of functions used when writing strings. bytes.Buffer, bufio.Writer & strings.Builder all implement this interface.
Although these methods expose the standard Go writer semantics of returning errors, users of StringWriter generally do not check for errors. Constructors of this interface should arrange to detect errors externally if needed (e.g. by checking the result of Flush on a bufio.Writer).