File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,16 @@ import (
12
12
"sync"
13
13
)
14
14
15
+ const defaultCacheTag = "schema"
16
+
15
17
var errInvalidPath = errors .New ("schema: invalid path" )
16
18
17
19
// newCache returns a new cache.
18
20
func newCache () * cache {
19
21
c := cache {
20
22
m : make (map [reflect.Type ]* structInfo ),
21
23
regconv : make (map [reflect.Type ]Converter ),
22
- tag : "schema" ,
24
+ tag : defaultCacheTag ,
23
25
}
24
26
return & c
25
27
}
Original file line number Diff line number Diff line change @@ -525,9 +525,7 @@ func TestRegisterEncoderWithPtrType(t *testing.T) {
525
525
}
526
526
527
527
func TestNewEncoderWithOptions (t * testing.T ) {
528
- defaultEncoder := NewEncoder ()
529
-
530
- aliasTag := defaultEncoder .cache .tag + "-test"
528
+ aliasTag := defaultCacheTag + "-test"
531
529
encoder := NewEncoder (
532
530
WithAliasTagEncoderOpt (aliasTag ),
533
531
)
You can’t perform that action at this time.
0 commit comments