Replace go.mod package with git.gammaspectra.live/P2Pool/go-json
This commit is contained in:
parent
2410a4c5e9
commit
60d2daca40
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
|||
PKG := github.com/goccy/go-json
|
||||
PKG := git.gammaspectra.live/P2Pool/go-json
|
||||
|
||||
BIN_DIR := $(CURDIR)/bin
|
||||
PKGS := $(shell go list ./... | grep -v internal/cmd|grep -v test)
|
||||
|
|
22
README.md
22
README.md
|
@ -1,7 +1,7 @@
|
|||
# go-json
|
||||
|
||||
![Go](https://github.com/goccy/go-json/workflows/Go/badge.svg)
|
||||
[![GoDoc](https://godoc.org/github.com/goccy/go-json?status.svg)](https://pkg.go.dev/github.com/goccy/go-json?tab=doc)
|
||||
![Go](https://git.gammaspectra.live/P2Pool/go-json/workflows/Go/badge.svg)
|
||||
[![GoDoc](https://godoc.org/git.gammaspectra.live/P2Pool/go-json?status.svg)](https://pkg.go.dev/git.gammaspectra.live/P2Pool/go-json?tab=doc)
|
||||
[![codecov](https://codecov.io/gh/goccy/go-json/branch/master/graph/badge.svg)](https://codecov.io/gh/goccy/go-json)
|
||||
|
||||
Fast JSON encoder/decoder compatible with encoding/json for Go
|
||||
|
@ -22,12 +22,12 @@ Fast JSON encoder/decoder compatible with encoding/json for Go
|
|||
```
|
||||
|
||||
We are accepting requests for features that will be implemented between v0.9.0 and v.1.0.0.
|
||||
If you have the API you need, please submit your issue [here](https://github.com/goccy/go-json/issues).
|
||||
If you have the API you need, please submit your issue [here](https://git.gammaspectra.live/P2Pool/go-json/issues).
|
||||
|
||||
# Features
|
||||
|
||||
- Drop-in replacement of `encoding/json`
|
||||
- Fast ( See [Benchmark section](https://github.com/goccy/go-json#benchmarks) )
|
||||
- Fast ( See [Benchmark section](https://git.gammaspectra.live/P2Pool/go-json#benchmarks) )
|
||||
- Flexible customization with options
|
||||
- Coloring the encoded string
|
||||
- Can propagate context.Context to `MarshalJSON` or `UnmarshalJSON`
|
||||
|
@ -36,16 +36,16 @@ If you have the API you need, please submit your issue [here](https://github.com
|
|||
# Installation
|
||||
|
||||
```
|
||||
go get github.com/goccy/go-json
|
||||
go get git.gammaspectra.live/P2Pool/go-json
|
||||
```
|
||||
|
||||
# How to use
|
||||
|
||||
Replace import statement from `encoding/json` to `github.com/goccy/go-json`
|
||||
Replace import statement from `encoding/json` to `git.gammaspectra.live/P2Pool/go-json`
|
||||
|
||||
```
|
||||
-import "encoding/json"
|
||||
+import "github.com/goccy/go-json"
|
||||
+import "git.gammaspectra.live/P2Pool/go-json"
|
||||
```
|
||||
|
||||
# JSON library comparison
|
||||
|
@ -98,8 +98,8 @@ $ go test -bench .
|
|||
|
||||
# Fuzzing
|
||||
|
||||
[go-json-fuzz](https://github.com/goccy/go-json-fuzz) is the repository for fuzzing tests.
|
||||
If you run the test in this repository and find a bug, please commit to corpus to go-json-fuzz and report the issue to [go-json](https://github.com/goccy/go-json/issues).
|
||||
[go-json-fuzz](https://git.gammaspectra.live/P2Pool/go-json-fuzz) is the repository for fuzzing tests.
|
||||
If you run the test in this repository and find a bug, please commit to corpus to go-json-fuzz and report the issue to [go-json](https://git.gammaspectra.live/P2Pool/go-json/issues).
|
||||
|
||||
# How it works
|
||||
|
||||
|
@ -192,7 +192,7 @@ For this reason, to date `reflect.Type` is the same as `*reflect.rtype`.
|
|||
|
||||
Therefore, by directly handling `*reflect.rtype`, which is an implementation of `reflect.Type`, it is possible to avoid escaping because it changes from `interface` to using `struct`.
|
||||
|
||||
The technique for working with `*reflect.rtype` directly from `go-json` is implemented at [rtype.go](https://github.com/goccy/go-json/blob/master/internal/runtime/rtype.go)
|
||||
The technique for working with `*reflect.rtype` directly from `go-json` is implemented at [rtype.go](https://git.gammaspectra.live/P2Pool/go-json/blob/master/internal/runtime/rtype.go)
|
||||
|
||||
Also, the same technique is cut out as a library ( https://github.com/goccy/go-reflect )
|
||||
|
||||
|
@ -353,7 +353,7 @@ However, if there is too much type information, it will use a lot of memory, so
|
|||
|
||||
If this approach is not available, it will fall back to the `atomic` based process described above.
|
||||
|
||||
If you want to know more, please refer to the implementation [here](https://github.com/goccy/go-json/blob/master/internal/runtime/type.go#L36-L100)
|
||||
If you want to know more, please refer to the implementation [here](https://git.gammaspectra.live/P2Pool/go-json/blob/master/internal/runtime/type.go#L36-L100)
|
||||
|
||||
## Decoder
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import (
|
|||
|
||||
stdjson "encoding/json"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
segmentiojson "github.com/segmentio/encoding/json"
|
||||
"github.com/wI2L/jettison"
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
gojson "git.gammaspectra.live/P2Pool/go-json"
|
||||
gojay "github.com/francoispqt/gojay"
|
||||
gojson "github.com/goccy/go-json"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
segmentiojson "github.com/segmentio/encoding/json"
|
||||
fastjson "github.com/valyala/fastjson"
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
gojson "git.gammaspectra.live/P2Pool/go-json"
|
||||
gojay "github.com/francoispqt/gojay"
|
||||
gojson "github.com/goccy/go-json"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/pquerna/ffjson/ffjson"
|
||||
segmentiojson "github.com/segmentio/encoding/json"
|
||||
|
|
|
@ -4,7 +4,7 @@ go 1.12
|
|||
|
||||
require (
|
||||
github.com/francoispqt/gojay v1.2.13
|
||||
github.com/goccy/go-json v0.0.0-00010101000000-000000000000
|
||||
git.gammaspectra.live/P2Pool/go-json v0.0.0-00010101000000-000000000000
|
||||
github.com/json-iterator/go v1.1.10
|
||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe
|
||||
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7
|
||||
|
@ -14,4 +14,4 @@ require (
|
|||
github.com/wI2L/jettison v0.7.1
|
||||
)
|
||||
|
||||
replace github.com/goccy/go-json => ../
|
||||
replace git.gammaspectra.live/P2Pool/go-json => ../
|
||||
|
|
|
@ -3,7 +3,7 @@ package benchmark
|
|||
import (
|
||||
"testing"
|
||||
|
||||
gojson "github.com/goccy/go-json"
|
||||
gojson "git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func Benchmark_Decode_SmallStruct_UnmarshalPath_GoJson(b *testing.B) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
gojson "github.com/goccy/go-json"
|
||||
gojson "git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
// Benchmark decoding from a slow io.Reader that never fills the buffer completely
|
||||
|
|
2
color.go
2
color.go
|
@ -3,7 +3,7 @@ package json
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
@ -3,7 +3,7 @@ package json_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestColorize(t *testing.T) {
|
||||
|
|
|
@ -7,9 +7,9 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/decoder"
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/decoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type Decoder struct {
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func Test_Decoder(t *testing.T) {
|
||||
|
@ -123,7 +123,7 @@ func Test_Decoder(t *testing.T) {
|
|||
assertEq(t, "map.c", v["c"], 3)
|
||||
assertEq(t, "map.d", v["d"], 4)
|
||||
t.Run("nested map", func(t *testing.T) {
|
||||
// https://github.com/goccy/go-json/issues/8
|
||||
// https://git.gammaspectra.live/P2Pool/go-json/issues/8
|
||||
content := `
|
||||
{
|
||||
"a": {
|
||||
|
|
10
encode.go
10
encode.go
|
@ -6,11 +6,11 @@ import (
|
|||
"os"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/encoder/vm"
|
||||
"github.com/goccy/go-json/internal/encoder/vm_color"
|
||||
"github.com/goccy/go-json/internal/encoder/vm_color_indent"
|
||||
"github.com/goccy/go-json/internal/encoder/vm_indent"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder/vm"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder/vm_color"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder/vm_color_indent"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder/vm_indent"
|
||||
)
|
||||
|
||||
// An Encoder writes JSON values to an output stream.
|
||||
|
|
|
@ -18,7 +18,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type recursiveT struct {
|
||||
|
|
2
error.go
2
error.go
|
@ -1,7 +1,7 @@
|
|||
package json
|
||||
|
||||
import (
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
// Before Go 1.2, an InvalidUTF8Error was returned by Marshal when
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package json
|
||||
|
||||
import (
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,3 +1,3 @@
|
|||
module github.com/goccy/go-json
|
||||
module git.gammaspectra.live/P2Pool/go-json
|
||||
|
||||
go 1.19
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"sort"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package decoder
|
|||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type anonymousFieldDecoder struct {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type arrayDecoder struct {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
type boolDecoder struct {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type bytesDecoder struct {
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"unicode"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -6,7 +6,7 @@ package decoder
|
|||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
func CompileToGetDecoder(typ *runtime.Type) (Decoder, error) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
var decMu sync.RWMutex
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
type RuntimeContext struct {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"strconv"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
type floatDecoder struct {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type funcDecoder struct {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type intDecoder struct {
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type interfaceDecoder struct {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type invalidDecoder struct {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type mapDecoder struct {
|
||||
|
@ -36,7 +36,7 @@ const (
|
|||
mapMaxElemSize = 128
|
||||
)
|
||||
|
||||
// See detail: https://github.com/goccy/go-json/pull/283
|
||||
// See detail: https://git.gammaspectra.live/P2Pool/go-json/pull/283
|
||||
func canUseAssignFaststrType(key *runtime.Type, value *runtime.Type) bool {
|
||||
indirectElem := value.Size() > mapMaxElemSize
|
||||
if indirectElem {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"strconv"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
type numberDecoder struct {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"reflect"
|
||||
"strconv"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type PathString string
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type ptrDecoder struct {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strconv"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"unicode/utf8"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
type stringDecoder struct {
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"unicode/utf16"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
type structFieldSet struct {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type uintDecoder struct {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type unmarshalJSONDecoder struct {
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
"unicode/utf8"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type unmarshalTextDecoder struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type wrappedStringDecoder struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type Code interface {
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strconv"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"sync/atomic"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type marshalerContext interface {
|
||||
|
@ -489,7 +489,7 @@ func (c *Compiler) listElemCode(typ *runtime.Type) (Code, error) {
|
|||
default:
|
||||
// isPtr was originally used to indicate whether the type of top level is pointer.
|
||||
// However, since the slice/array element is a specification that can get the pointer address, explicitly set isPtr to true.
|
||||
// See here for related issues: https://github.com/goccy/go-json/issues/370
|
||||
// See here for related issues: https://git.gammaspectra.live/P2Pool/go-json/issues/370
|
||||
code, err := c.typeToCodeWithPtr(typ, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
type compileContext struct {
|
||||
|
|
|
@ -13,8 +13,8 @@ import (
|
|||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
func (t OpType) IsMultipleOpHead() bool {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/goccy/go-json/internal/errors"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/errors"
|
||||
)
|
||||
|
||||
func takeIndentSrcRuntimeContext(src []byte) (*RuntimeContext, []byte) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -5,5 +5,5 @@ import (
|
|||
// `vm`, `vm_indent`, `vm_color`, `vm_color_indent` packages uses a lot of memory to compile,
|
||||
// so forcibly make dependencies and avoid compiling in concurrent.
|
||||
// dependency order: vm => vm_indent => vm_color => vm_color_indent
|
||||
_ "github.com/goccy/go-json/internal/encoder/vm_indent"
|
||||
_ "git.gammaspectra.live/P2Pool/go-json/internal/encoder/vm_indent"
|
||||
)
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"sort"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package vm_color
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -5,5 +5,5 @@ import (
|
|||
// `vm`, `vm_indent`, `vm_color`, `vm_color_indent` packages uses a lot of memory to compile,
|
||||
// so forcibly make dependencies and avoid compiling in concurrent.
|
||||
// dependency order: vm => vm_indent => vm_color => vm_color_indent
|
||||
_ "github.com/goccy/go-json/internal/encoder/vm_color_indent"
|
||||
_ "git.gammaspectra.live/P2Pool/go-json/internal/encoder/vm_color_indent"
|
||||
)
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"sort"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package vm_color_indent
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"sort"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package vm_indent
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
|
@ -5,5 +5,5 @@ import (
|
|||
// `vm`, `vm_indent`, `vm_color`, `vm_color_indent` packages uses a lot of memory to compile,
|
||||
// so forcibly make dependencies and avoid compiling in concurrent.
|
||||
// dependency order: vm => vm_indent => vm_color => vm_color_indent
|
||||
_ "github.com/goccy/go-json/internal/encoder/vm_color"
|
||||
_ "git.gammaspectra.live/P2Pool/go-json/internal/encoder/vm_color"
|
||||
)
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
"sort"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/runtime"
|
||||
)
|
||||
|
||||
func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
|
||||
|
|
2
json.go
2
json.go
|
@ -5,7 +5,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
// Marshaler is the interface implemented by types that
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
var validTests = []struct {
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"regexp"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestNumberIsValid(t *testing.T) {
|
||||
|
|
|
@ -3,8 +3,8 @@ package json
|
|||
import (
|
||||
"io"
|
||||
|
||||
"github.com/goccy/go-json/internal/decoder"
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/decoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
type EncodeOption = encoder.Option
|
||||
|
|
2
path.go
2
path.go
|
@ -3,7 +3,7 @@ package json
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/goccy/go-json/internal/decoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/decoder"
|
||||
)
|
||||
|
||||
// CreatePath creates JSON Path.
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"sort"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestExtractPath(t *testing.T) {
|
||||
|
|
2
query.go
2
query.go
|
@ -1,7 +1,7 @@
|
|||
package json
|
||||
|
||||
import (
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type queryTestX struct {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"unsafe"
|
||||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"git.gammaspectra.live/P2Pool/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
func TestOpcodeSize(t *testing.T) {
|
||||
|
|
|
@ -19,7 +19,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
// Test values for the stream test.
|
||||
|
|
|
@ -7,7 +7,7 @@ package json_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type basicLatin2xTag struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type customArray [2]int
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type customBool bool
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverBytes(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverFloat32(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverFloat64(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
stdjson "encoding/json"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func intptr(v int) *int { return &v }
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverInt16(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverInt32(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverInt64(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverInt8(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverInt(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type recursiveMap struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type coverMarshalJSON struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type coverMarshalText struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverNumber(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type coverSliceMarshalJSON struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverString(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverUint16(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverUint32(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverUint64(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverUint8(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
func TestCoverUint(t *testing.T) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type Animal int
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/goccy/go-json"
|
||||
"git.gammaspectra.live/P2Pool/go-json"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue