Skip to content

Commit 381b78e

Browse files
committed
fixed undue move of reflect declarations
Signed-off-by: Frederic BIDON <[email protected]>
1 parent 31411a0 commit 381b78e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

errors.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
package jsonpointer
22

3-
import (
4-
"reflect"
5-
)
6-
73
type pointerError string
84

95
func (e pointerError) Error() string {
106
return string(e)
117
}
128

13-
var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem()
14-
var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem()
15-
169
const (
1710
// ErrPointer is an error raised by the jsonpointer package
1811
ErrPointer pointerError = "JSON pointer error"
1912

20-
// ErrInvalidStart states that a JSON pointer must start with a separator
13+
// ErrInvalidStart states that a JSON pointer must start with a separator ("/")
2114
ErrInvalidStart pointerError = `JSON pointer must be empty or start with a "` + pointerSeparator
2215

2316
// ErrUnsupportedValueType indicates that a value of the wrong type is being set

pointer.go

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ const (
4141
pointerSeparator = `/`
4242
)
4343

44+
var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem()
45+
var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem()
46+
4447
// JSONPointable is an interface for structs to implement when they need to customize the
4548
// json pointer process
4649
type JSONPointable interface {

0 commit comments

Comments
 (0)