package main import ( "fmt" ) func run(c <-chan int){ var _ = c } type Reader struct{ a int } type Writer struct{ a int } func (w *Writer) run(){ fmt.Println("run") fmt.Println(w.a) } func (r *Reader) run(){ fmt.Println("run") fmt.Println(r.a) } type ReadWriter struct { a int Reader // *bufio.Reader Writer // *bufio.Writer } func main() { fmt.Println("Hello, playground") var rw = ReadWriter{42,Reader{1}, Writer{2}} fmt.Println(rw) rw.run() }
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.