forked from golang/mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
external.go
70 lines (55 loc) · 1.32 KB
/
external.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package generics
import (
"context"
"github.com/johnpena/mock/mockgen/internal/tests/generics/other"
"golang.org/x/exp/constraints"
)
//go:generate mockgen --source=external.go --destination=source/mock_external_test.go --package source
type ExternalConstraint[I constraints.Integer, F constraints.Float] interface {
One(string) string
Two(I) string
Three(I) F
Four(I) Foo[I, F]
Five(I) Baz[F]
Six(I) *Baz[F]
Seven(I) other.One[I]
Eight(F) other.Two[I, F]
Nine(Iface[I])
Ten(*I)
}
type EmbeddingIface[T constraints.Integer, R constraints.Float] interface {
other.Twenty[T, StructType, R, other.Five]
TwentyTwo[StructType]
other.TwentyThree[TwentyTwo[R], TwentyTwo[T]]
TwentyFour[other.StructType]
Foo() error
ExternalConstraint[T, R]
}
type TwentyOne[T any] interface {
TwentyOne() T
}
type TwentyFour[T other.StructType] interface {
TwentyFour() T
}
type Clonable[T any] interface {
Clone() T
}
type Finder[T Clonable[T]] interface {
Find(ctx context.Context) ([]T, error)
}
type UpdateNotifier[T any] interface {
NotifyC(ctx context.Context) <-chan []T
Refresh(ctx context.Context)
}
type EmbeddedW[W StructType] interface {
EmbeddedY[W]
}
type EmbeddedX[X StructType] interface {
EmbeddedY[X]
}
type EmbeddedY[Y StructType] interface {
EmbeddedZ[Y]
}
type EmbeddedZ[Z any] interface {
EmbeddedZ(Z)
}