migrate go version to 1.17 (#203)

* migrate go version to 1.17

* update contributing
This commit is contained in:
tobi
2021-09-10 14:42:14 +02:00
committed by GitHub
parent e681aac589
commit f2e5bedea6
282 changed files with 11863 additions and 12600 deletions

View File

@ -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) {