Skip to content

Commit

Permalink
Use json-iterator instead of encoding/json
Browse files Browse the repository at this point in the history
Signed-off-by: Nalin Dahyabhai <[email protected]>
  • Loading branch information
nalind committed May 6, 2021
1 parent 4e3bb7e commit 5ef1e9d
Show file tree
Hide file tree
Showing 123 changed files with 11,896 additions and 11 deletions.
1 change: 0 additions & 1 deletion containers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package storage

import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand Down
1 change: 0 additions & 1 deletion drivers/chown.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package graphdriver

import (
"bytes"
"encoding/json"
"fmt"
"os"

Expand Down
1 change: 0 additions & 1 deletion drivers/devmapper/device_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package devmapper
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
Expand Down
1 change: 0 additions & 1 deletion drivers/devmapper/deviceset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package devmapper

import (
"bufio"
"encoding/json"
"fmt"
"io"
"io/ioutil"
Expand Down
5 changes: 5 additions & 0 deletions drivers/devmapper/jsoniter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package devmapper

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
5 changes: 5 additions & 0 deletions drivers/jsoniter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package graphdriver

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
5 changes: 5 additions & 0 deletions drivers/overlay/jsoniter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package overlay

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
1 change: 0 additions & 1 deletion drivers/overlay/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package overlay

import (
"bytes"
"encoding/json"
"flag"
"fmt"
"os"
Expand Down
5 changes: 5 additions & 0 deletions drivers/windows/jsoniter_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package windows

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
1 change: 0 additions & 1 deletion drivers/windows/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"archive/tar"
"bufio"
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/docker/go-units v0.4.0
github.com/google/go-intervals v0.0.2
github.com/hashicorp/go-multierror v1.1.1
github.com/json-iterator/go v1.1.11
github.com/klauspost/compress v1.12.2
github.com/klauspost/pgzip v1.2.5
github.com/mattn/go-shellwords v1.0.11
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
Expand Down Expand Up @@ -377,8 +379,10 @@ github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2J
github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ=
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
Expand Down
1 change: 0 additions & 1 deletion images.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package storage

import (
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
Expand Down
5 changes: 5 additions & 0 deletions jsoniter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package storage

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
1 change: 0 additions & 1 deletion layers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package storage

import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
Expand Down
1 change: 0 additions & 1 deletion pkg/chrootarchive/archive_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package chrootarchive

import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
Expand Down
1 change: 0 additions & 1 deletion pkg/chrootarchive/diff_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package chrootarchive

import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
Expand Down
5 changes: 5 additions & 0 deletions pkg/chrootarchive/jsoniter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package chrootarchive

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
1 change: 0 additions & 1 deletion store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package storage

import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/json-iterator/go/.codecov.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/github.com/json-iterator/go/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions vendor/github.com/json-iterator/go/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/json-iterator/go/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions vendor/github.com/json-iterator/go/Gopkg.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/json-iterator/go/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 87 additions & 0 deletions vendor/github.com/json-iterator/go/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5ef1e9d

Please sign in to comment.