This PR changes the wording of a few errors to make it clearer. These improvements are mainly based on me encountering the errors due to silly mistakes and realising they are not as useful as they could be.
The changes are:
In parser.go:
Add example of how a io type should be qualified when it is not
Include the raw strings in some error messages (this PR builds on #40)
Mention the type when its tag is malformed
Reword a few things
In prepare.go
Include the raw section of string from the query that contains the error
Put quotes round struct types since we can have anonymous structs in a list which have an empty string for a type name (e.g. as can be see in the db_test.go file in PR #42).
Separate error if the user doesn't pass any types at all to prepare (and there is at least one type needed)
Seperate error if the user passes a pointer/list and rewording of an error if its anything else that is not a struct
In complete.go
Rewording for consistency
Separate error if the user doesn't pass any inputs an we need at least one
Error for multiple of the same struct
In expr_test.go
Removed/combine superfluous tests in the main table driven section
Refactor some tests into a table driven format
Made testing struct names and fields consistent across the file
This PR changes the wording of a few errors to make it clearer. These improvements are mainly based on me encountering the errors due to silly mistakes and realising they are not as useful as they could be.
The changes are:
parser.go
:prepare.go
db_test.go
file in PR #42).complete.go
expr_test.go