File: generics.go

package info (click to toggle)
golang-go.uber-mock 0.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,176 kB
  • sloc: sh: 37; makefile: 3
file content (40 lines) | stat: -rw-r--r-- 999 bytes parent folder | download
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
package typed

import "go.uber.org/mock/mockgen/internal/tests/typed/other"

//go:generate mockgen --source=generics.go --destination=source/mock_generics_test.go --package source -typed
////go:generate mockgen --destination=reflect/mock_test.go --package reflect . Bar,Bar2

type Bar[T any, R any] interface {
	One(string) string
	Two(T) string
	Three(T) R
	Four(T) Foo[T, R]
	Five(T) Baz[T]
	Six(T) *Baz[T]
	Seven(T) other.One[T]
	Eight(T) other.Two[T, R]
	Nine(Iface[T])
	Ten(*T)
	Eleven() (*other.One[T], error)
	Twelve() (*other.Two[T, R], error)
	Thirteen() (Baz[StructType], error)
	Fourteen() (*Foo[StructType, StructType2], error)
	Fifteen() (Iface[StructType], error)
	Sixteen() (Baz[other.Three], error)
	Seventeen() (*Foo[other.Three, other.Four], error)
	Eighteen() (Iface[*other.Five], error)
	Nineteen() AliasType
}

type Foo[T any, R any] struct{}

type Baz[T any] struct{}

type Iface[T any] any

type StructType struct{}

type StructType2 struct{}

type AliasType Baz[other.Three]