vektah / dataloaden

go generate based DataLoader
MIT License
530 stars 79 forks source link

Better error message when no package name found #40

Open susisu opened 5 years ago

susisu commented 5 years ago

Fixes (in a sense) #35

The error message is a bit confusing when no package name found for the working directory (for example, an empty directory).

$ go run github.com/vektah/dataloaden UserLoader uint64 *example.com/model.User
unable to gofmt:/path/to/example.com/dataloader/userloader_gen.go:6:1: expected 'IDENT', found 'import'
exit status 2

This pr makes the message clearer.

$ go run github.com/vektah/dataloaden UserLoader uint64 *example.com/model.User
unable to find package name for /path/to/example.com/dataloader
exit status 2