...
Source file
src/go/types/chan.go
1
2
3
4
5
6
7 package types
8
9
10 type Chan struct {
11 dir ChanDir
12 elem Type
13 }
14
15
16 type ChanDir int
17
18
19 const (
20 SendRecv ChanDir = iota
21 SendOnly
22 RecvOnly
23 )
24
25
26 func NewChan(dir ChanDir, elem Type) *Chan {
27 return &Chan{dir: dir, elem: elem}
28 }
29
30
31 func (c *Chan) Dir() ChanDir { return c.dir }
32
33
34 func (c *Chan) Elem() Type { return c.elem }
35
36 func (c *Chan) Underlying() Type { return c }
37 func (c *Chan) String() string { return TypeString(c, nil) }
38
View as plain text