packer-cn/template
Jake Champlin aca4aed47c Display better error messages on json.SyntaxError
Better display an error message on an encounter of a json.SyntaxError.

Rolls back the file position, to read the entire file, then steps
through the file reading a single byte at a time, populating lines until
encountering the syntax error. Then relays the offending line as well as
the previous line in the file to the user, also placing a `^` that
points the the offending column of the decoder error.

```
➤  packer validate template.json
Failed to parse template: Error parsing JSON: invalid character '"' after object key:value pair
At line 9, column 8 (offset 121):
    8:       "name": "vbox"
    9:       "
```
2016-02-10 14:52:26 -05:00
..
interpolate Fixes #2777: isotime interpolation uses InitTime 2015-10-06 16:45:30 -07:00
test-fixtures Fix #2742: Include template line numbers on error 2015-10-25 12:28:06 -07:00
parse.go Display better error messages on json.SyntaxError 2016-02-10 14:52:26 -05:00
parse_test.go Display better error messages on json.SyntaxError 2016-02-10 14:52:26 -05:00
template.go template: stores the path 2015-05-29 14:05:13 -07:00
template_test.go template: OnlyExcept skipping 2015-05-26 09:07:16 -07:00