Created
October 27, 2015 05:29
-
-
Save GoesToEleven/448ff723e02774503b70 to your computer and use it in GitHub Desktop.
Golang Buffer (bytes.Buffer)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b bytes.Buffer // A Buffer needs no initialization. | |
b.Write([]byte("Hello ")) | |
fmt.Fprintf(&b, "world!") | |
b.WriteTo(os.Stdout) | |
// OUTPUT: | |
// Hello world! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment