ovechkin-dm / mockio

Mockito for golang
MIT License
73 stars 2 forks source link

Revisit custom matcher API #76

Closed ovechkin-dm closed 1 month ago

ovechkin-dm commented 1 month ago

Suggestion is to provide simpler api like this:

func CreateMatcher[T any](description string, f func(allArgs []any, actual T) bool) func() T {
   ...
}

So that usage would be like this:

odd := CreateMatcher(...)
mock.Foo(odd(), odd())