aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
committerLibravatar Rutger Broekhoff2024-01-02 18:56:31 +0100
commit8db41da676ac8368ef7c2549d56239a5ff5eedde (patch)
tree09c427fd66de2ec1ebffc8342f5fdbb84b0701b5 /vendor/github.com/json-iterator/go/reflect_json_raw_message.go
parentd4f75fb6db22e57577867445a022227e70958931 (diff)
downloadgitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.tar.gz
gitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.zip
Delete vendor directory
Diffstat (limited to 'vendor/github.com/json-iterator/go/reflect_json_raw_message.go')
-rw-r--r--vendor/github.com/json-iterator/go/reflect_json_raw_message.go76
1 files changed, 0 insertions, 76 deletions
diff --git a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
deleted file mode 100644
index eba434f..0000000
--- a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
+++ /dev/null
@@ -1,76 +0,0 @@
1package jsoniter
2
3import (
4 "encoding/json"
5 "github.com/modern-go/reflect2"
6 "unsafe"
7)
8
9var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()
10var jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()
11
12func createEncoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValEncoder {
13 if typ == jsonRawMessageType {
14 return &jsonRawMessageCodec{}
15 }
16 if typ == jsoniterRawMessageType {
17 return &jsoniterRawMessageCodec{}
18 }
19 return nil
20}
21
22func createDecoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValDecoder {
23 if typ == jsonRawMessageType {
24 return &jsonRawMessageCodec{}
25 }
26 if typ == jsoniterRawMessageType {
27 return &jsoniterRawMessageCodec{}
28 }
29 return nil
30}
31
32type jsonRawMessageCodec struct {
33}
34
35func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
36 if iter.ReadNil() {
37 *((*json.RawMessage)(ptr)) = nil
38 } else {
39 *((*json.RawMessage)(ptr)) = iter.SkipAndReturnBytes()
40 }
41}
42
43func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
44 if *((*json.RawMessage)(ptr)) == nil {
45 stream.WriteNil()
46 } else {
47 stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
48 }
49}
50
51func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
52 return len(*((*json.RawMessage)(ptr))) == 0
53}
54
55type jsoniterRawMessageCodec struct {
56}
57
58func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
59 if iter.ReadNil() {
60 *((*RawMessage)(ptr)) = nil
61 } else {
62 *((*RawMessage)(ptr)) = iter.SkipAndReturnBytes()
63 }
64}
65
66func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
67 if *((*RawMessage)(ptr)) == nil {
68 stream.WriteNil()
69 } else {
70 stream.WriteRaw(string(*((*RawMessage)(ptr))))
71 }
72}
73
74func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
75 return len(*((*RawMessage)(ptr))) == 0
76}