/
any_nil.go
22 lines (19 loc) · 1.23 KB
/
any_nil.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package jsoni
import "context"
type nilAny struct{ baseAny }
func (a *nilAny) LastError() error { return nil }
func (a *nilAny) ValueType() ValueType { return NilValue }
func (a *nilAny) MustBeValid() Any { return a }
func (a *nilAny) ToBool() bool { return false }
func (a *nilAny) ToInt() int { return 0 }
func (a *nilAny) ToInt32() int32 { return 0 }
func (a *nilAny) ToInt64() int64 { return 0 }
func (a *nilAny) ToUint() uint { return 0 }
func (a *nilAny) ToUint32() uint32 { return 0 }
func (a *nilAny) ToUint64() uint64 { return 0 }
func (a *nilAny) ToFloat32() float32 { return 0 }
func (a *nilAny) ToFloat64() float64 { return 0 }
func (a *nilAny) ToString() string { return "" }
func (a *nilAny) WriteTo(_ context.Context, stream *Stream) { stream.WriteNil() }
func (a *nilAny) Parse() *Iterator { return nil }
func (a *nilAny) GetInterface(context.Context) interface{} { return nil }