Skip to content

Commit 5ef1e9d

Browse files
committed
Use json-iterator instead of encoding/json
Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent 4e3bb7e commit 5ef1e9d

File tree

123 files changed

+11896
-11
lines changed

Some content is hidden

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

123 files changed

+11896
-11
lines changed

containers.go

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package storage
22

33
import (
4-
"encoding/json"
54
"fmt"
65
"io/ioutil"
76
"os"

drivers/chown.go

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package graphdriver
22

33
import (
44
"bytes"
5-
"encoding/json"
65
"fmt"
76
"os"
87

drivers/devmapper/device_setup.go

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package devmapper
55
import (
66
"bufio"
77
"bytes"
8-
"encoding/json"
98
"fmt"
109
"io/ioutil"
1110
"os"

drivers/devmapper/deviceset.go

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package devmapper
44

55
import (
66
"bufio"
7-
"encoding/json"
87
"fmt"
98
"io"
109
"io/ioutil"

drivers/devmapper/jsoniter.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package devmapper
2+
3+
import jsoniter "github.com/json-iterator/go"
4+
5+
var json = jsoniter.ConfigCompatibleWithStandardLibrary

drivers/jsoniter.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package graphdriver
2+
3+
import jsoniter "github.com/json-iterator/go"
4+
5+
var json = jsoniter.ConfigCompatibleWithStandardLibrary

drivers/overlay/jsoniter.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package overlay
2+
3+
import jsoniter "github.com/json-iterator/go"
4+
5+
var json = jsoniter.ConfigCompatibleWithStandardLibrary

drivers/overlay/mount.go

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package overlay
44

55
import (
66
"bytes"
7-
"encoding/json"
87
"flag"
98
"fmt"
109
"os"

drivers/windows/jsoniter_windows.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package windows
2+
3+
import jsoniter "github.com/json-iterator/go"
4+
5+
var json = jsoniter.ConfigCompatibleWithStandardLibrary

drivers/windows/windows.go

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"archive/tar"
77
"bufio"
88
"bytes"
9-
"encoding/json"
109
"errors"
1110
"fmt"
1211
"io"

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/docker/go-units v0.4.0
1010
github.com/google/go-intervals v0.0.2
1111
github.com/hashicorp/go-multierror v1.1.1
12+
github.com/json-iterator/go v1.1.11
1213
github.com/klauspost/compress v1.12.2
1314
github.com/klauspost/pgzip v1.2.5
1415
github.com/mattn/go-shellwords v1.0.11

go.sum

+4
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
330330
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
331331
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
332332
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
333+
github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
334+
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
333335
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
334336
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
335337
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
@@ -377,8 +379,10 @@ github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2J
377379
github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ=
378380
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
379381
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
382+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
380383
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
381384
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
385+
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
382386
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
383387
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
384388
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=

images.go

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package storage
22

33
import (
4-
"encoding/json"
54
"io/ioutil"
65
"os"
76
"path/filepath"

jsoniter.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package storage
2+
3+
import jsoniter "github.com/json-iterator/go"
4+
5+
var json = jsoniter.ConfigCompatibleWithStandardLibrary

layers.go

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package storage
22

33
import (
44
"bytes"
5-
"encoding/json"
65
"fmt"
76
"io"
87
"io/ioutil"

pkg/chrootarchive/archive_unix.go

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package chrootarchive
44

55
import (
66
"bytes"
7-
"encoding/json"
87
"flag"
98
"fmt"
109
"io"

pkg/chrootarchive/diff_unix.go

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package chrootarchive
44

55
import (
66
"bytes"
7-
"encoding/json"
87
"flag"
98
"fmt"
109
"io"

pkg/chrootarchive/jsoniter.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package chrootarchive
2+
3+
import jsoniter "github.com/json-iterator/go"
4+
5+
var json = jsoniter.ConfigCompatibleWithStandardLibrary

store.go

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package storage
22

33
import (
44
"encoding/base64"
5-
"encoding/json"
65
"fmt"
76
"io"
87
"io/ioutil"

vendor/github.com/json-iterator/go/.codecov.yml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/json-iterator/go/.gitignore

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/json-iterator/go/.travis.yml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/json-iterator/go/Gopkg.lock

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/json-iterator/go/Gopkg.toml

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/json-iterator/go/LICENSE

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/json-iterator/go/README.md

+87
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)