Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions errors.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions pointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading