code: func displaySyntaxError(data []byte, syntaxError error) (err error) {
  	syntax, ok := syntaxError.(*json.SyntaxError)
  	if !ok {
  		err = syntaxError
  		return
  	}
  	newline := []byte{'\x0a'}
  	space := []byte{' '}
  
  	start, end := bytes.LastIndex(data[:syntax.Offset], newline)+1, len(data)
  	if idx := bytes.Index(data[start:], newline); idx >= 0 {
  		end = start + idx
  	}
  
  	line, pos := bytes.Count(data[:start], newline)+1, int(syntax.Offset)-start-1
  
  	err = fmt.Errorf("\nError in line %d: %s \n%s\n%s^", line, syntaxError, data[start:end], bytes.Repeat(space, pos))
  	return
  }
docs: // displaySyntaxError will display more information
  // such as line and error type given an error and
  // the data that was unmarshalled.
  // Thanks to https://github.com/markpeek/packer/commit/5bf33a0e91b2318a40c42e9bf855dcc8dd4cdec5