diff options
| author | 2023-11-27 13:15:03 +0000 | |
|---|---|---|
| committer | 2023-11-27 13:15:03 +0000 | |
| commit | 66b77acb1c8b86f0be3836ccaf31683c0bfa317a (patch) | |
| tree | 9a255a8ea8ef97229b6d75d17de45bdac1755be9 /vendor/github.com/bytedance/sonic/sonic.go | |
| parent | [bugfix] Add Actor to outgoing poll vote Create; other fixes (#2384) (diff) | |
| download | gotosocial-66b77acb1c8b86f0be3836ccaf31683c0bfa317a.tar.xz | |
[chore]: Bump github.com/gin-contrib/cors from 1.4.0 to 1.5.0 (#2388)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/bytedance/sonic/sonic.go')
| -rw-r--r-- | vendor/github.com/bytedance/sonic/sonic.go | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/vendor/github.com/bytedance/sonic/sonic.go b/vendor/github.com/bytedance/sonic/sonic.go index 6cbb1ad41..1da238895 100644 --- a/vendor/github.com/bytedance/sonic/sonic.go +++ b/vendor/github.com/bytedance/sonic/sonic.go @@ -1,4 +1,4 @@ -// +build amd64,go1.15,!go1.21 +// +build amd64,go1.16,!go1.22 /* * Copyright 2021 ByteDance Inc. @@ -58,6 +58,9 @@ func (cfg Config) Froze() API { if cfg.ValidateString { api.encoderOpts |= encoder.ValidateString } + if cfg.NoValidateJSONMarshaler { + api.encoderOpts |= encoder.NoValidateJSONMarshaler + } // configure decoder options: if cfg.UseInt64 { @@ -139,23 +142,23 @@ func (cfg frozenConfig) Valid(data []byte) bool { // Opts are the compile options, for example, "option.WithCompileRecursiveDepth" is // a compile option to set the depth of recursive compile for the nested struct type. func Pretouch(vt reflect.Type, opts ...option.CompileOption) error { - if err := encoder.Pretouch(vt, opts...); err != nil { - return err - } - if err := decoder.Pretouch(vt, opts...); err != nil { - return err - } - // to pretouch the corresponding pointer type as well - if vt.Kind() == reflect.Ptr { - vt = vt.Elem() - } else { - vt = reflect.PtrTo(vt) - } - if err := encoder.Pretouch(vt, opts...); err != nil { - return err - } - if err := decoder.Pretouch(vt, opts...); err != nil { - return err - } - return nil + if err := encoder.Pretouch(vt, opts...); err != nil { + return err + } + if err := decoder.Pretouch(vt, opts...); err != nil { + return err + } + // to pretouch the corresponding pointer type as well + if vt.Kind() == reflect.Ptr { + vt = vt.Elem() + } else { + vt = reflect.PtrTo(vt) + } + if err := encoder.Pretouch(vt, opts...); err != nil { + return err + } + if err := decoder.Pretouch(vt, opts...); err != nil { + return err + } + return nil } |
