From abe117b7d3fa5f20b9b618126a7504857fb64b60 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 20 Apr 2018 23:49:45 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20mask=20the=20named=20return=20v?= =?UTF-8?q?alues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The defer function is expecting an expression value, not a nil value, and therefore we shouldn’t override the named return values in the function. --- sql/exprs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/exprs.go b/sql/exprs.go index b9eb458a..7e4adaaa 100644 --- a/sql/exprs.go +++ b/sql/exprs.go @@ -854,7 +854,7 @@ func (p *parser) parsePath(expr ...Expr) (path *PathExpression, err error) { part, err = p.parseStep() if err != nil { - return nil, err + return } if part == nil { @@ -877,7 +877,7 @@ func (p *parser) parsePath(expr ...Expr) (path *PathExpression, err error) { join, err = p.parseJoin() if err != nil { - return nil, err + return } if join == nil { @@ -893,7 +893,7 @@ func (p *parser) parsePath(expr ...Expr) (path *PathExpression, err error) { part, err = p.parseStep() if err != nil { - return nil, err + return } if part == nil {