-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for generating mocks for generic interfaces
- Loading branch information
1 parent
68d25fe
commit dc5539e
Showing
5 changed files
with
275 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
module github.com/vektra/mockery/v2 | ||
|
||
go 1.16 | ||
go 1.18 | ||
|
||
require ( | ||
github.com/mitchellh/go-homedir v1.1.0 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/rs/zerolog v1.26.1 | ||
github.com/spf13/afero v1.8.0 // indirect | ||
github.com/spf13/cobra v1.3.0 | ||
github.com/spf13/viper v1.10.1 | ||
github.com/stretchr/testify v1.7.0 | ||
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce | ||
golang.org/x/tools v0.1.10 | ||
gopkg.in/yaml.v2 v2.4.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/fsnotify/fsnotify v1.5.1 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/magiconair/properties v1.8.5 // indirect | ||
github.com/mitchellh/mapstructure v1.4.3 // indirect | ||
github.com/pelletier/go-toml v1.9.4 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/spf13/afero v1.8.0 // indirect | ||
github.com/spf13/cast v1.4.1 // indirect | ||
github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/stretchr/objx v0.1.1 // indirect | ||
github.com/subosito/gotenv v1.2.0 // indirect | ||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect | ||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect | ||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect | ||
golang.org/x/tools v0.1.10 | ||
golang.org/x/text v0.3.7 // indirect | ||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect | ||
gopkg.in/ini.v1 v1.66.3 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 | ||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package test | ||
|
||
type Constraint interface { | ||
int | ||
} | ||
|
||
type Generic[T Constraint] interface { | ||
Get() T | ||
} | ||
|
||
type GenericAny[T any] interface { | ||
Get() T | ||
} | ||
|
||
type GenericComparable[T comparable] interface { | ||
Get() T | ||
} | ||
|
||
type Embedded interface { | ||
Generic[int] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.