Last active
June 5, 2022 10:25
-
-
Save narenaryan/70cee857f48dd6bbd5a5c80be9143e5e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"fmt" | |
) | |
func main() { | |
// Empty buffer (implements io.Writer) | |
var b bytes.Buffer | |
fmt.Fprintln(&b, "Hello Medium") // Don't forget & | |
// Optional: Check the contents stored | |
fmt.Println(b.String()) // Prints `Hello Medium` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment