cheekybits / genny

Elegant generics for Go
MIT License
1.71k stars 167 forks source link

Check if specific type name has a valid syntax #72

Open alexey-sveshnikov opened 3 years ago

alexey-sveshnikov commented 3 years ago

Hi!

Looks like I misunderstood the concepts of genny and passed a specific type with a package name as genny arguments. The problem is that an error message is not pointed to the cause directly it's not trivial to debug. Actually, I resorted to binary search to figure it out.

Code:

//go:generate genny -pkg=test -in=../templates/main.go -out=main.go gen "MyType=package.SpecificType"

Error:

Failed to goimports the generated code: ../templates/main.go:10:12: expected type, found '.' (and 1 more errors)
main.go:3: running "genny": exit status 4