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