jsonutils

package module
v0.0.0-...-f24c8bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2015 License: BSD-2-Clause Imports: 4 Imported by: 0

README

jsonutils

golang utils for json marshalling/unmarshalling

Syntax Error

is a error wrapping around json.SyntaxError to provide an error message with more info. For that it needs the contents of the file that were parsed at the time of the error.

###TODO

  • write tests

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyntaxError

type SyntaxError struct {
	// contains filtered or unexported fields
}

SyntaxError wraps around json.SyntaxError to provide better context by it's Error().The original error is available through the method Original

func NewSyntaxError

func NewSyntaxError(original *json.SyntaxError, jsonContents []byte, contextSize int64) *SyntaxError

NewSyntaxError returns a SyntaxError wrapping around json.SyntaxError. The provided jsonContents should be the input that produced the error the contextSize is the number of lines around the to be printed as well

Notice: in the message all the tabs are replaced by a single space

func (*SyntaxError) Error

func (s *SyntaxError) Error() string

func (*SyntaxError) Original

func (s *SyntaxError) Original() *json.SyntaxError

Original returns the original json.SyntaxError

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL