diff options
author | 2021-09-10 14:42:14 +0200 | |
---|---|---|
committer | 2021-09-10 14:42:14 +0200 | |
commit | f2e5bedea6fb93fbbf68ed8f7153c353cc57a9f0 (patch) | |
tree | 475ae9e7470d0df670ab2a59dce351cd1d07498a /vendor/github.com/goccy/go-json/internal/encoder/context.go | |
parent | fixes + db changes (#204) (diff) | |
download | gotosocial-f2e5bedea6fb93fbbf68ed8f7153c353cc57a9f0.tar.xz |
migrate go version to 1.17 (#203)
* migrate go version to 1.17
* update contributing
Diffstat (limited to 'vendor/github.com/goccy/go-json/internal/encoder/context.go')
-rw-r--r-- | vendor/github.com/goccy/go-json/internal/encoder/context.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vendor/github.com/goccy/go-json/internal/encoder/context.go b/vendor/github.com/goccy/go-json/internal/encoder/context.go index d7e030eaa..61b890806 100644 --- a/vendor/github.com/goccy/go-json/internal/encoder/context.go +++ b/vendor/github.com/goccy/go-json/internal/encoder/context.go @@ -1,6 +1,7 @@ package encoder import ( + "context" "sync" "unsafe" @@ -9,9 +10,10 @@ import ( type compileContext struct { typ *runtime.Type - opcodeIndex int + opcodeIndex uint32 ptrIndex int - indent int + indent uint32 + escapeKey bool structTypeToCompiledCode map[uintptr]*CompiledCode parent *compileContext @@ -23,6 +25,7 @@ func (c *compileContext) context() *compileContext { opcodeIndex: c.opcodeIndex, ptrIndex: c.ptrIndex, indent: c.indent, + escapeKey: c.escapeKey, structTypeToCompiledCode: c.structTypeToCompiledCode, parent: c, } @@ -95,20 +98,23 @@ var ( Buf: make([]byte, 0, bufSize), Ptrs: make([]uintptr, 128), KeepRefs: make([]unsafe.Pointer, 0, 8), + Option: &Option{}, } }, } ) type RuntimeContext struct { + Context context.Context Buf []byte MarshalBuf []byte Ptrs []uintptr KeepRefs []unsafe.Pointer SeenPtr []uintptr - BaseIndent int + BaseIndent uint32 Prefix []byte IndentStr []byte + Option *Option } func (c *RuntimeContext) Init(p uintptr, codelen int) { |