-
Notifications
You must be signed in to change notification settings - Fork 95
/
external.go
43 lines (36 loc) · 896 Bytes
/
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
package generics
import (
"context"
"io"
"go.uber.org/mock/mockgen/internal/tests/generics/other"
"golang.org/x/exp/constraints"
)
//go:generate mockgen --source=external.go --destination=source/mock_external_mock.go --package source
type ExternalConstraint[I constraints.Integer, F any] 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)
Eleven() map[string]I
Twelve(ctx context.Context) <-chan []I
Thirteen(...I) *F
}
type EmbeddingIface[T constraints.Integer, R constraints.Float] interface {
io.Reader
Generator[R]
Earth[Generator[T]]
other.Either[R, StructType, other.Five, Generator[T]]
ExternalConstraint[T, R]
}
type Generator[T any] interface {
Generate() T
}
type Group[T Generator[any]] interface {
Join(ctx context.Context) []T
}