Improve serialization error handling.

This commit is contained in:
zer0sub 2019-05-13 12:33:11 +02:00
parent 1fd63b8783
commit 5ed7cf2b1c
8 changed files with 81 additions and 39 deletions

View file

@ -86,6 +86,9 @@ func (s *selectStatementImpl) FROM(table readableTable) selectStatement {
}
func (s *selectStatementImpl) serialize(statement statementType, out *queryData) error {
if s == nil {
return errors.New("Select statement is nil. ")
}
out.writeString("(")
out.increaseIdent()
@ -103,6 +106,9 @@ func (s *selectStatementImpl) serialize(statement statementType, out *queryData)
}
func (s *selectStatementImpl) serializeImpl(out *queryData) error {
if s == nil {
return errors.New("Select statement is nil. ")
}
out.nextLine()
out.writeString("SELECT")