Skip to content

Instantly share code, notes, and snippets.

@narenaryan
Created June 5, 2022 11:07
Show Gist options
  • Save narenaryan/a03c3d62578fe9142f53787d5c552317 to your computer and use it in GitHub Desktop.
Save narenaryan/a03c3d62578fe9142f53787d5c552317 to your computer and use it in GitHub Desktop.
package main
import (
"bytes"
"fmt"
"strings"
)
func main() {
// Create a reader
r := strings.NewReader("Hello Medium")
// Create a writer
var b bytes.Buffer
// Pull data
b.ReadFrom(r)
// Optional: verify data
fmt.Println(b.String())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment