You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
Any Get will never return nil
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
package jsoniter
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Any interface {
|
||||
LastError() error
|
||||
ValueType() ValueType
|
||||
ToBool() bool
|
||||
ToInt() int
|
||||
ToInt32() int32
|
||||
@ -26,7 +29,7 @@ type Any interface {
|
||||
type baseAny struct{}
|
||||
|
||||
func (any *baseAny) Get(path ...interface{}) Any {
|
||||
return &invalidAny{}
|
||||
return &invalidAny{baseAny{}, fmt.Errorf("Get %v from simple value", path)}
|
||||
}
|
||||
|
||||
func (any *baseAny) Size() int {
|
||||
|
Reference in New Issue
Block a user