2012-02-16 21:49:30 -07:00
|
|
|
// run
|
2009-12-15 17:22:04 -07:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
2009-12-15 17:22:04 -07:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type S string
|
|
|
|
type I int
|
2011-01-19 21:09:00 -07:00
|
|
|
type F float64
|
2009-12-15 17:22:04 -07:00
|
|
|
|
|
|
|
func (S) m() {}
|
|
|
|
func (I) m() {}
|
|
|
|
func (F) m() {}
|
|
|
|
|
|
|
|
func main() {
|
2011-01-19 21:09:00 -07:00
|
|
|
c := make(chan interface {
|
|
|
|
m()
|
|
|
|
},
|
|
|
|
10)
|
2009-12-15 17:22:04 -07:00
|
|
|
c <- I(0)
|
|
|
|
c <- F(1)
|
|
|
|
c <- S("hi")
|
|
|
|
<-c
|
|
|
|
<-c
|
|
|
|
<-c
|
|
|
|
}
|