Skip to content

Commit fce2893

Browse files
committed
Fix lint errors
1 parent cb338cc commit fce2893

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

parser/parser_query.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,18 @@ func (p *Parser) parseSelectStatement(pos Pos) (*SelectQuery, error) { // nolint
790790
}
791791
if parsedLimitBy != nil {
792792
statementEnd = parsedLimitBy.End()
793-
if e, ok := parsedLimitBy.(*LimitByExpr); ok {
793+
switch e := parsedLimitBy.(type) {
794+
case *LimitByExpr:
794795
limitByExpr = e
795796
limitExpr, err = p.tryParseLimitExpr(p.Pos())
796-
} else {
797-
limitExpr = parsedLimitBy.(*LimitExpr)
797+
if err != nil {
798+
return nil, err
799+
}
800+
if limitExpr != nil {
801+
statementEnd = limitExpr.End()
802+
}
803+
case *LimitExpr:
804+
limitExpr = e
798805
}
799806
}
800807

0 commit comments

Comments
 (0)