cweill / gotests

Automatically generate Go test boilerplate from your source code.
Apache License 2.0
4.92k stars 346 forks source link

not support generic #182

Closed bigobject closed 1 year ago

bigobject commented 1 year ago

when use type constraints to implement a generic function, we get this error: illegal character U+007E '~' (and 3 more errors)

code: type equalTypes interface { ~string | ~int32 }

func hasMember[T equalTypes](slice []T, member T) bool { for _, item := range slice { if item == member { return true } } return false }