Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Created March 9, 2018 08:01
Show Gist options
  • Save ceaksan/f41a44974402724303162ff94d170388 to your computer and use it in GitHub Desktop.
Save ceaksan/f41a44974402724303162ff94d170388 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
)
type Reader interface {
Read(b []byte) (n int, err error)
}
type Writer interface {
Write(b []byte) (n int, err error)
}
type ReadWriter interface {
Reader
Writer
}
func main() {
var w Writer
// os.Stdout implements Writer
w = os.Stdout
fmt.Fprintf(w, "hello, writer\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment