Skip to content

Instantly share code, notes, and snippets.

@kinshuk4
Forked from maddyonline/reader-writer-example.go
Created August 21, 2016 10:28
Show Gist options
  • Save kinshuk4/fa966e57c9f43e1d806b09382c3fe2bf to your computer and use it in GitHub Desktop.
Save kinshuk4/fa966e57c9f43e1d806b09382c3fe2bf to your computer and use it in GitHub Desktop.
Golang
package main
import "io"
import "os"
import "strings"
import "bytes"
func main() {
r1 := strings.NewReader("Hello")
r2 := bytes.NewReader([]byte(" World!"))
io.Copy(os.Stdout, r1)
io.Copy(os.Stdout, r2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment