Skip to content

Commit cafb4d4

Browse files
add go.mod, adjust import paths
replaces all encoding/json/ imports with github.com/quic-go/json/
1 parent 27740fb commit cafb4d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+146
-122
lines changed

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/quic-go/json
2+
3+
go 1.24

internal/jsonflags/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// These flags are shared across both "json", "jsontext", and "jsonopts".
99
package jsonflags
1010

11-
import "encoding/json/internal"
11+
import "github.com/quic-go/json/internal"
1212

1313
// Bools represents zero or more boolean flags, all set to true or false.
1414
// The least-significant bit is the boolean value of all flags in the set.

internal/jsonopts/options.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
package jsonopts
88

99
import (
10-
"encoding/json/internal"
11-
"encoding/json/internal/jsonflags"
10+
"github.com/quic-go/json/internal"
11+
12+
"github.com/quic-go/json/internal/jsonflags"
1213
)
1314

1415
// Options is the common options type shared across json packages.

internal/jsonopts/options_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import (
1010
"reflect"
1111
"testing"
1212

13-
"encoding/json/internal/jsonflags"
14-
. "encoding/json/internal/jsonopts"
15-
"encoding/json/jsontext"
16-
"encoding/json/v2"
13+
"github.com/quic-go/json/jsontext"
14+
"github.com/quic-go/json/v2"
15+
16+
"github.com/quic-go/json/internal/jsonflags"
17+
. "github.com/quic-go/json/internal/jsonopts"
1718
)
1819

1920
func makeFlags(f ...jsonflags.Bools) (fs jsonflags.Flags) {

internal/jsonwire/encode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"unicode/utf16"
1414
"unicode/utf8"
1515

16-
"encoding/json/internal/jsonflags"
16+
"github.com/quic-go/json/internal/jsonflags"
1717
)
1818

1919
// escapeASCII reports whether the ASCII character needs to be escaped.

internal/jsonwire/encode_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"testing"
2323
"time"
2424

25-
"encoding/json/internal/jsonflags"
25+
"github.com/quic-go/json/internal/jsonflags"
2626
)
2727

2828
func TestAppendQuote(t *testing.T) {

jsontext/coder_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
"strings"
1818
"testing"
1919

20-
"encoding/json/internal/jsontest"
21-
"encoding/json/internal/jsonwire"
20+
"github.com/quic-go/json/internal/jsontest"
21+
"github.com/quic-go/json/internal/jsonwire"
2222
)
2323

2424
func E(err error) *SyntacticError {

jsontext/decode.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"errors"
1212
"io"
1313

14-
"encoding/json/internal/jsonflags"
15-
"encoding/json/internal/jsonopts"
16-
"encoding/json/internal/jsonwire"
14+
"github.com/quic-go/json/internal/jsonflags"
15+
"github.com/quic-go/json/internal/jsonopts"
16+
"github.com/quic-go/json/internal/jsonwire"
1717
)
1818

1919
// NOTE: The logic for decoding is complicated by the fact that reading from

jsontext/decode_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919
"testing"
2020
"testing/iotest"
2121

22-
"encoding/json/internal/jsonflags"
23-
"encoding/json/internal/jsontest"
24-
"encoding/json/internal/jsonwire"
22+
"github.com/quic-go/json/internal/jsonflags"
23+
"github.com/quic-go/json/internal/jsontest"
24+
"github.com/quic-go/json/internal/jsonwire"
2525
)
2626

2727
// equalTokens reports whether to sequences of tokens formats the same way.

jsontext/encode.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"io"
1212
"math/bits"
1313

14-
"encoding/json/internal/jsonflags"
15-
"encoding/json/internal/jsonopts"
16-
"encoding/json/internal/jsonwire"
14+
"github.com/quic-go/json/internal/jsonflags"
15+
"github.com/quic-go/json/internal/jsonopts"
16+
"github.com/quic-go/json/internal/jsonwire"
1717
)
1818

1919
// Encoder is a streaming encoder from raw JSON tokens and values.

0 commit comments

Comments
 (0)