Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadAll ¶
ReadAll reads all data from r and returns it as a byte slice. A successful call returns err == nil, not err == EOF. It does not treat an EOF as an error to be reported.
This function is similar to io.ReadAll, but uses a bytes.Buffer to accumulate the data, which has a more efficient growing algorithm and uses io.WriterTo if r implements it.
Example ¶
r := strings.NewReader("The quick brown fox jumps over the lazy dog.") b, err := ReadAll(r) if err != nil { log.Fatal(err) } fmt.Printf("%s", b)
Output: The quick brown fox jumps over the lazy dog.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.