Skip to content

Instantly share code, notes, and snippets.

@narenaryan
Last active June 5, 2022 12:11
Show Gist options
  • Save narenaryan/6e9d385d2d8563338668d63c12895770 to your computer and use it in GitHub Desktop.
Save narenaryan/6e9d385d2d8563338668d63c12895770 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"io"
"strings"
)
func main() {
// Create a new reader (Readonly)
r := strings.NewReader("Hello Medium")
// Read all content from reader
b, err := io.ReadAll(r)
if err != nil {
panic(err)
}
// Optional: verify data
fmt.Println(string(b))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment