...
1
2 package user
3
4
5
6
7 import (
8 "io"
9
10 btz "bytes"
11 "hash"
12 "log"
13 "net"
14 "net/http"
15
16
17 t1 "html/template"
18
19 t2 "text/template"
20
21 "github.com/golang/mock/sample/imp1"
22
23
24
25 renamed2 "github.com/golang/mock/sample/imp2"
26
27 . "github.com/golang/mock/sample/imp3"
28
29 imp_four "github.com/golang/mock/sample/imp4"
30 )
31
32
33
34
35
36
37 type Index interface {
38 Get(key string) interface{}
39 GetTwo(key1, key2 string) (v1, v2 interface{})
40 Put(key string, value interface{})
41
42
43 Summary(buf *btz.Buffer, w io.Writer)
44 Other() hash.Hash
45 Templates(a t1.CSS, b t2.FuncMap)
46
47
48 Anon(string)
49
50
51 ForeignOne(imp1.Imp1)
52 ForeignTwo(renamed2.Imp2)
53 ForeignThree(Imp3)
54 ForeignFour(imp_four.Imp4)
55
56
57 NillableRet() error
58
59 ConcreteRet() chan<- bool
60
61
62 Ellip(fmt string, args ...interface{})
63 EllipOnly(...string)
64
65
66 Ptr(arg *int)
67
68
69 Slice(a []int, b []byte) [3]int
70
71
72 Chan(a chan int, b chan<- hash.Hash)
73
74
75 Func(f func(http.Request) (int, bool))
76
77
78 Map(a map[int]hash.Hash)
79
80
81 Struct(a struct{})
82 StructChan(a chan struct{})
83 }
84
85
86 type Embed interface {
87 RegularMethod()
88 Embedded
89 imp1.ForeignEmbedded
90 }
91
92 type Embedded interface {
93 EmbeddedMethod()
94 }
95
96
97 var _ net.Addr
98
99
100
101 func Remember(index Index, keys []string, values []interface{}) {
102 for i, k := range keys {
103 index.Put(k, values[i])
104 }
105 err := index.NillableRet()
106 if err != nil {
107 log.Fatalf("Woah! %v", err)
108 }
109 if len(keys) > 0 && keys[0] == "a" {
110 index.Ellip("%d", 0, 1, 1, 2, 3)
111 index.Ellip("%d", 1, 3, 6, 10, 15)
112 index.EllipOnly("arg")
113 }
114 }
115
116 func GrabPointer(index Index) int {
117 var a int
118 index.Ptr(&a)
119 return a
120 }
121
View as plain text