diff --git a/errors.go b/errors.go index e83fc6b..b84343d 100644 --- a/errors.go +++ b/errors.go @@ -1,23 +1,16 @@ package jsonpointer -import ( - "reflect" -) - type pointerError string func (e pointerError) Error() string { return string(e) } -var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem() -var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem() - const ( // ErrPointer is an error raised by the jsonpointer package ErrPointer pointerError = "JSON pointer error" - // ErrInvalidStart states that a JSON pointer must start with a separator + // ErrInvalidStart states that a JSON pointer must start with a separator ("/") ErrInvalidStart pointerError = `JSON pointer must be empty or start with a "` + pointerSeparator // ErrUnsupportedValueType indicates that a value of the wrong type is being set diff --git a/pointer.go b/pointer.go index 6604261..a08cd68 100644 --- a/pointer.go +++ b/pointer.go @@ -41,6 +41,9 @@ const ( pointerSeparator = `/` ) +var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem() +var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem() + // JSONPointable is an interface for structs to implement when they need to customize the // json pointer process type JSONPointable interface {