Skip to content

Commit 1b2b06f

Browse files
authored
Merge pull request #247 from ernado/go-modules
Use go modules
2 parents b2ccc51 + 81f2536 commit 1b2b06f

File tree

9 files changed

+3954
-6723
lines changed

9 files changed

+3954
-6723
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ language: go
22

33
go:
44
- tip
5+
- stable
6+
7+
matrix:
8+
allow_failures:
9+
- go: tip
10+
511
install:
6-
- go get github.com/ugorji/go/codec
7-
- go get github.com/pquerna/ffjson/fflib/v1
8-
- go get github.com/json-iterator/go
912
- go get golang.org/x/lint/golint

Makefile

Lines changed: 39 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,52 @@
1-
PKG=github.com/mailru/easyjson
2-
GOPATH:=$(PWD)/.root:$(GOPATH)
3-
export GOPATH
4-
51
all: test
62

7-
.root/src/$(PKG):
8-
mkdir -p $@
9-
for i in $$PWD/* ; do ln -s $$i $@/`basename $$i` ; done
10-
11-
root: .root/src/$(PKG)
12-
133
clean:
14-
rm -rf .root
4+
rm -rf bin
155
rm -rf tests/*_easyjson.go
6+
rm -rf benchmark/*_easyjson.go
167

178
build:
18-
go build -i -o .root/bin/easyjson $(PKG)/easyjson
19-
20-
generate: root build
21-
.root/bin/easyjson -stubs \
22-
.root/src/$(PKG)/tests/snake.go \
23-
.root/src/$(PKG)/tests/data.go \
24-
.root/src/$(PKG)/tests/omitempty.go \
25-
.root/src/$(PKG)/tests/nothing.go \
26-
.root/src/$(PKG)/tests/named_type.go \
27-
.root/src/$(PKG)/tests/custom_map_key_type.go \
28-
.root/src/$(PKG)/tests/embedded_type.go \
29-
.root/src/$(PKG)/tests/reference_to_pointer.go \
30-
31-
.root/bin/easyjson -all .root/src/$(PKG)/tests/data.go
32-
.root/bin/easyjson -all .root/src/$(PKG)/tests/nothing.go
33-
.root/bin/easyjson -all .root/src/$(PKG)/tests/errors.go
34-
.root/bin/easyjson -snake_case .root/src/$(PKG)/tests/snake.go
35-
.root/bin/easyjson -omit_empty .root/src/$(PKG)/tests/omitempty.go
36-
.root/bin/easyjson -build_tags=use_easyjson .root/src/$(PKG)/benchmark/data.go
37-
.root/bin/easyjson .root/src/$(PKG)/tests/nested_easy.go
38-
.root/bin/easyjson .root/src/$(PKG)/tests/named_type.go
39-
.root/bin/easyjson .root/src/$(PKG)/tests/custom_map_key_type.go
40-
.root/bin/easyjson .root/src/$(PKG)/tests/embedded_type.go
41-
.root/bin/easyjson .root/src/$(PKG)/tests/reference_to_pointer.go
42-
.root/bin/easyjson .root/src/$(PKG)/tests/key_marshaler_map.go
43-
.root/bin/easyjson -disallow_unknown_fields .root/src/$(PKG)/tests/disallow_unknown.go
44-
45-
test: generate root
9+
go build -i -o ./bin/easyjson ./easyjson
10+
11+
generate: build
12+
bin/easyjson -stubs \
13+
./tests/snake.go \
14+
./tests/data.go \
15+
./tests/omitempty.go \
16+
./tests/nothing.go \
17+
./tests/named_type.go \
18+
./tests/custom_map_key_type.go \
19+
./tests/embedded_type.go \
20+
./tests/reference_to_pointer.go \
21+
22+
bin/easyjson -all ./tests/data.go
23+
bin/easyjson -all ./tests/nothing.go
24+
bin/easyjson -all ./tests/errors.go
25+
bin/easyjson -snake_case ./tests/snake.go
26+
bin/easyjson -omit_empty ./tests/omitempty.go
27+
bin/easyjson -build_tags=use_easyjson ./benchmark/data.go
28+
bin/easyjson ./tests/nested_easy.go
29+
bin/easyjson ./tests/named_type.go
30+
bin/easyjson ./tests/custom_map_key_type.go
31+
bin/easyjson ./tests/embedded_type.go
32+
bin/easyjson ./tests/reference_to_pointer.go
33+
bin/easyjson ./tests/key_marshaler_map.go
34+
bin/easyjson -disallow_unknown_fields ./tests/disallow_unknown.go
35+
36+
test: generate
4637
go test \
47-
$(PKG)/tests \
48-
$(PKG)/jlexer \
49-
$(PKG)/gen \
50-
$(PKG)/buffer
51-
go test -benchmem -tags use_easyjson -bench . $(PKG)/benchmark
52-
golint -set_exit_status .root/src/$(PKG)/tests/*_easyjson.go
38+
./tests \
39+
./jlexer \
40+
./gen \
41+
./buffer
42+
cd benchmark && go test -benchmem -tags use_easyjson -bench .
43+
golint -set_exit_status ./tests/*_easyjson.go
5344

54-
bench-other: generate root
55-
@go test -benchmem -bench . $(PKG)/benchmark
56-
@go test -benchmem -tags use_ffjson -bench . $(PKG)/benchmark
57-
@go test -benchmem -tags use_jsoniter -bench . $(PKG)/benchmark
58-
@go test -benchmem -tags use_codec -bench . $(PKG)/benchmark
45+
bench-other: generate
46+
cd benchmark && make
5947

6048
bench-python:
6149
benchmark/ujson.sh
6250

6351

64-
.PHONY: root clean generate test build
52+
.PHONY: clean generate test build

benchmark/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
all:
2+
go test -benchmem -bench .
3+
go test -benchmem -tags use_ffjson -bench .
4+
go test -benchmem -tags use_jsoniter -bench .
5+
go test -benchmem -tags use_codec -bench .

0 commit comments

Comments
 (0)