Skip to content

Commit

Permalink
Merge pull request hashicorp#197 from sean-/f-stray-error
Browse files Browse the repository at this point in the history
Return an error instead of printing stray `illegal\n` to stdout.
  • Loading branch information
mitchellh authored Apr 20, 2017
2 parents 630949a + 20ef8cf commit 7fa7fff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion json/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7fa7fff

Please sign in to comment.