gojuno / minimock

Powerful mock generation tool for Go programming language
MIT License
574 stars 38 forks source link

Mock for generic interface failed #73

Closed musinit closed 6 months ago

musinit commented 11 months ago

The error: failed to find any interfaces matching Interface[T in {package_name}

I have an ICache[T any] interface and I am trying to mock it with flag -i ICache[T any]

hexdigest commented 6 months ago

Hi @musinit

It should work but you have to slightly change you command line, examples can be found here:

$ ag genericSimpleUnion
Makefile
14: go run ./cmd/minimock/minimock.go -i ./tests.genericSimpleUnion -o ./tests/generic_simple_union.go

tests/types.go
51: genericSimpleUnion[T simpleUnion] interface {

in your case it should be just -i ICache