Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use jsoniter instead of easyjson #2105

Merged
merged 6 commits into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ run-perftest: perftest
vagrant-check:
BOX=$(BOX) sh ./vagrant.sh

binaries: varlink_generate easyjson_generate podman
binaries: varlink_generate podman

install.catatonit:
./hack/install_catatonit.sh
Expand Down Expand Up @@ -265,7 +265,7 @@ uninstall:

.PHONY: install.tools

install.tools: .install.gitvalidation .install.gometalinter .install.md2man .install.easyjson .install.ginkgo .install.gomega
install.tools: .install.gitvalidation .install.gometalinter .install.md2man .install.ginkgo .install.gomega

.install.gomega: .gopathok
$(GO) get github.com/onsi/gomega/...
Expand Down Expand Up @@ -294,11 +294,6 @@ install.tools: .install.gitvalidation .install.gometalinter .install.md2man .ins
$(GO) get -u github.com/cpuguy83/go-md2man; \
fi

.install.easyjson: .gopathok
if [ ! -x "$(GOBIN)/easyffjson" ]; then \
$(GO) get -u github.com/mailru/easyjson/...; \
fi

.install.ostree: .gopathok
if ! pkg-config ostree-1 2> /dev/null ; then \
git clone https://github.com/ostreedev/ostree $(FIRST_GOPATH)/src/github.com/ostreedev/ostree ; \
Expand All @@ -310,16 +305,6 @@ install.tools: .install.gitvalidation .install.gometalinter .install.md2man .ins
varlink_generate: .gopathok cmd/podman/varlink/iopodman.go
varlink_api_generate: .gopathok API.md

easyjson_generate: .gopathok libpod/container_easyjson.go libpod/pod_easyjson.go

libpod/container_easyjson.go: libpod/container.go
rm -f libpod/container_easyjson.go
cd "$(GOPKGDIR)" && easyjson -build_tags "$(BUILDTAGS)" ./libpod/container.go

libpod/pod_easyjson.go: libpod/pod.go
rm -f libpod/pod_easyjson.go
cd "$(GOPKGDIR)" && easyjson -build_tags "$(BUILDTAGS)" ./libpod/pod.go

.PHONY: install.libseccomp.sudo
install.libseccomp.sudo:
rm -rf ../../seccomp/libseccomp
Expand Down
4 changes: 3 additions & 1 deletion libpod/boltdb_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ package libpod

import (
"bytes"
"encoding/json"
"strings"
"sync"

"github.com/boltdb/bolt"
jsoniter "github.com/json-iterator/go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

var json = jsoniter.ConfigCompatibleWithStandardLibrary

// BoltState is a state implementation backed by a Bolt DB
type BoltState struct {
valid bool
Expand Down
1 change: 0 additions & 1 deletion libpod/boltdb_state_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package libpod

import (
"bytes"
"encoding/json"
"runtime"
"strings"

Expand Down
1 change: 0 additions & 1 deletion libpod/common_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package libpod

import (
"encoding/json"
"net"
"reflect"
"strings"
Expand Down
1 change: 0 additions & 1 deletion libpod/container.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package libpod

import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
Expand Down
Loading