From 20ef8cf57fe789d8d5d7bb55aa522479e8ab0fe3 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Thu, 20 Apr 2017 16:09:49 -0700 Subject: [PATCH] Return an error instead of printing stray `illegal\n` to stdout. --- json/parser/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/parser/parser.go b/json/parser/parser.go index 6f46085..125a5f0 100644 --- a/json/parser/parser.go +++ b/json/parser/parser.go @@ -147,7 +147,7 @@ func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { // Done return keys, nil case token.ILLEGAL: - fmt.Println("illegal") + return nil, errors.New("illegal") default: return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) }