sqs / goreturns

A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types
Other
530 stars 55 forks source link

Does it support go generate flag? #16

Closed shanicky closed 1 year ago

shanicky commented 9 years ago

Hi

when I set a flag like //go:generate stringer -type=AType I got an error like this

gofmt errors:
found packages gofmt23776Wlv.go (main) and gofmt41857elt.go (tmp) in /var/folders/fb/dfhfwkmn5pj01tvsrdf3pkq00000gn/T

when i change back to goimports the error disappear so dose it support generate flag?

sqs commented 9 years ago

I think this occurs because goreturns must compile and typecheck packages, not just individual source files (which is sufficient for goimports). It would be good to make it deal with this situation. PRs happily accepted to anyone who reads this!