diff options
author | Rutger Broekhoff | 2023-12-29 21:31:53 +0100 |
---|---|---|
committer | Rutger Broekhoff | 2023-12-29 21:31:53 +0100 |
commit | 404aeae4545d2426c089a5f8d5e82dae56f5212b (patch) | |
tree | 2d84e00af272b39fc04f3795ae06bc48970e57b5 /vendor/github.com/json-iterator/go/any_invalid.go | |
parent | 209d8b0187ed025dec9ac149ebcced3462877bff (diff) | |
download | gitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.tar.gz gitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.zip |
Make Nix builds work
Diffstat (limited to 'vendor/github.com/json-iterator/go/any_invalid.go')
-rw-r--r-- | vendor/github.com/json-iterator/go/any_invalid.go | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/vendor/github.com/json-iterator/go/any_invalid.go b/vendor/github.com/json-iterator/go/any_invalid.go new file mode 100644 index 0000000..1d859ea --- /dev/null +++ b/vendor/github.com/json-iterator/go/any_invalid.go | |||
@@ -0,0 +1,82 @@ | |||
1 | package jsoniter | ||
2 | |||
3 | import "fmt" | ||
4 | |||
5 | type invalidAny struct { | ||
6 | baseAny | ||
7 | err error | ||
8 | } | ||
9 | |||
10 | func newInvalidAny(path []interface{}) *invalidAny { | ||
11 | return &invalidAny{baseAny{}, fmt.Errorf("%v not found", path)} | ||
12 | } | ||
13 | |||
14 | func (any *invalidAny) LastError() error { | ||
15 | return any.err | ||
16 | } | ||
17 | |||
18 | func (any *invalidAny) ValueType() ValueType { | ||
19 | return InvalidValue | ||
20 | } | ||
21 | |||
22 | func (any *invalidAny) MustBeValid() Any { | ||
23 | panic(any.err) | ||
24 | } | ||
25 | |||
26 | func (any *invalidAny) ToBool() bool { | ||
27 | return false | ||
28 | } | ||
29 | |||
30 | func (any *invalidAny) ToInt() int { | ||
31 | return 0 | ||
32 | } | ||
33 | |||
34 | func (any *invalidAny) ToInt32() int32 { | ||
35 | return 0 | ||
36 | } | ||
37 | |||
38 | func (any *invalidAny) ToInt64() int64 { | ||
39 | return 0 | ||
40 | } | ||
41 | |||
42 | func (any *invalidAny) ToUint() uint { | ||
43 | return 0 | ||
44 | } | ||
45 | |||
46 | func (any *invalidAny) ToUint32() uint32 { | ||
47 | return 0 | ||
48 | } | ||
49 | |||
50 | func (any *invalidAny) ToUint64() uint64 { | ||
51 | return 0 | ||
52 | } | ||
53 | |||
54 | func (any *invalidAny) ToFloat32() float32 { | ||
55 | return 0 | ||
56 | } | ||
57 | |||
58 | func (any *invalidAny) ToFloat64() float64 { | ||
59 | return 0 | ||
60 | } | ||
61 | |||
62 | func (any *invalidAny) ToString() string { | ||
63 | return "" | ||
64 | } | ||
65 | |||
66 | func (any *invalidAny) WriteTo(stream *Stream) { | ||
67 | } | ||
68 | |||
69 | func (any *invalidAny) Get(path ...interface{}) Any { | ||
70 | if any.err == nil { | ||
71 | return &invalidAny{baseAny{}, fmt.Errorf("get %v from invalid", path)} | ||
72 | } | ||
73 | return &invalidAny{baseAny{}, fmt.Errorf("%v, get %v from invalid", any.err, path)} | ||
74 | } | ||
75 | |||
76 | func (any *invalidAny) Parse() *Iterator { | ||
77 | return nil | ||
78 | } | ||
79 | |||
80 | func (any *invalidAny) GetInterface() interface{} { | ||
81 | return nil | ||
82 | } | ||