Skip to content

Commit 6423ac6

Browse files
authored
Merge pull request #271 from tendermint/develop
Merge develop into master: - to tag and release v0.15.0 on master - to delete develop after that
2 parents dc14acf + a159742 commit 6423ac6

File tree

15 files changed

+202
-109
lines changed

15 files changed

+202
-109
lines changed

.circleci/config.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,21 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/golang:1.10.3
6-
environment:
7-
GOBIN: /tmp/workspace/bin
8-
9-
working_directory: /go/src/github.com/tendermint/go-amino
5+
- image: circleci/golang:1.12.0
106

117
steps:
12-
- run: mkdir -p /tmp/workspace/bin
13-
- run: mkdir -p /tmp/workspace/profiles
148
- checkout
159
- restore_cache:
1610
keys:
17-
- v1-dep-{{ .Branch }}
11+
- go-mod-v1-{{ checksum "go.sum" }}
1812
- run:
1913
name: test
2014
command: |
2115
export PATH="$GOBIN:$PATH"
2216
go env
2317
go version
24-
make get_tools && make get_vendor_deps && make test
18+
make get_tools && make && make test
2519
- save_cache:
26-
key: v1-dep-{{ .Branch }}
20+
key: go-mod-v1-{{ checksum "go.sum" }}
2721
paths:
28-
- /go/pkg
22+
- "/go/pkg/mod"

.golangci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
run:
2+
deadline: 1m
3+
4+
linters:
5+
enable-all: true
6+
disable:
7+
- gocyclo
8+
- golint
9+
- gosimple
10+
- goimports
11+
- unused
12+
- govet
13+
- deadcode
14+
- structcheck
15+
- maligned
16+
- errcheck
17+
- staticcheck
18+
- dupl
19+
- ineffassign
20+
- interfacer
21+
- unconvert
22+
- goconst
23+
- unparam
24+
- nakedret
25+
- lll
26+
- gochecknoglobals
27+
- gocritic
28+
- gochecknoinits
29+
- scopelint
30+
- stylecheck
31+
32+
# linters-settings:
33+
# govet:
34+
# check-shadowing: true
35+
# golint:
36+
# min-confidence: 0
37+
# gocyclo:
38+
# min-complexity: 10
39+
# maligned:
40+
# suggest-new: true
41+
# dupl:
42+
# threshold: 100
43+
# goconst:
44+
# min-len: 2
45+
# min-occurrences: 2
46+
# depguard:
47+
# list-type: blacklist
48+
# packages:
49+
# # logging is allowed only by logutils.Log, logrus
50+
# # is allowed to use only in logutils package
51+
# - github.com/sirupsen/logrus
52+
# misspell:
53+
# locale: US
54+
# lll:
55+
# line-length: 140
56+
# goimports:
57+
# local-prefixes: github.com/golangci/golangci-lint
58+
# gocritic:
59+
# enabled-tags:
60+
# - performance
61+
# - style
62+
# - experimental
63+
# disabled-checks:
64+
# - wrapperFunc
65+
# - commentFormatting # https://github.com/go-critic/go-critic/issues/755

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.15.0 (May 2, 2018)
4+
5+
BREAKING CHANGE:
6+
- JSON: Skip null fields on decoding when the `json:"omitempty"` tag is set.
7+
This matches the encoding behaviour ([#261]).
8+
9+
IMPROVEMENTS:
10+
- Amino becomes a go-module (requires go 1.11) but keeps dep support for backwards compatibility ([#255]).
11+
12+
13+
[#255]: https://github.com/tendermint/go-amino/pull/255
14+
[#261]: https://github.com/tendermint/go-amino/issues/261
15+
316
## 0.14.1 (November 6, 2018)
417

518
IMPROVEMENTS:

Gopkg.lock

Lines changed: 30 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727

2828
[[constraint]]
2929
name = "github.com/davecgh/go-spew"
30-
version = "1.1.0"
30+
version = "1.1.1"
3131

3232
[[constraint]]
3333
branch = "master"
3434
name = "github.com/google/gofuzz"
3535

3636
[[constraint]]
3737
name = "github.com/stretchr/testify"
38-
version = "1.2.1"
38+
version = "1.3.0"
3939

4040
[prune]
4141
go-tests = true

Makefile

Lines changed: 16 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
GOTOOLS = \
2-
github.com/golang/dep/cmd/dep \
3-
gopkg.in/alecthomas/gometalinter.v2
4-
GOTOOLS_CHECK = dep gometalinter.v2
2+
github.com/golangci/golangci-lint/cmd/golangci-lint
3+
GOTOOLS_CHECK = golangci-lint
54

6-
all: check_tools get_vendor_deps test metalinter
5+
all: check_tools test
76

87
########################################
98
### Build
@@ -25,17 +24,11 @@ check_tools:
2524

2625
get_tools:
2726
@echo "--> Installing tools"
28-
go get -u -v $(GOTOOLS)
29-
@gometalinter.v2 --install
27+
go get -v $(GOTOOLS)
3028

3129
update_tools:
3230
@echo "--> Updating tools"
33-
@go get -u $(GOTOOLS)
34-
35-
get_vendor_deps:
36-
@rm -rf vendor/
37-
@echo "--> Running dep ensure"
38-
@dep ensure
31+
@go get -u -v $(GOTOOLS)
3932

4033

4134
########################################
@@ -49,15 +42,17 @@ gofuzz_binary:
4942
rm -rf tests/fuzz/binary/crashers/
5043
rm -rf tests/fuzz/binary/suppressions/
5144
go run tests/fuzz/binary/init-corpus/main.go --corpus-parent=tests/fuzz/binary
52-
go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/binary
53-
go-fuzz -bin=./fuzz_binary-fuzz.zip -workdir=tests/fuzz/binary
45+
# TODO: update when https://github.com/dvyukov/go-fuzz/issues/195 is resolved
46+
GO111MODULE=off go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/binary
47+
GO111MODULE=off go-fuzz -bin=./fuzz_binary-fuzz.zip -workdir=tests/fuzz/binary
5448

5549
gofuzz_json:
5650
rm -rf tests/fuzz/json/corpus/
5751
rm -rf tests/fuzz/json/crashers/
5852
rm -rf tests/fuzz/json/suppressions/
59-
go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/json
60-
go-fuzz -bin=./fuzz_json-fuzz.zip -workdir=tests/fuzz/json
53+
# TODO: update when https://github.com/dvyukov/go-fuzz/issues/195 is resolved
54+
GO111MODULE=off go-fuzz-build github.com/tendermint/go-amino/tests/fuzz/json
55+
GO111MODULE=off go-fuzz -bin=./fuzz_json-fuzz.zip -workdir=tests/fuzz/json
6156

6257

6358
########################################
@@ -66,46 +61,12 @@ gofuzz_json:
6661
fmt:
6762
@go fmt ./...
6863

69-
metalinter:
70-
@echo "==> Running linter"
71-
gometalinter.v2 --vendor --deadline=600s --disable-all \
72-
--enable=deadcode \
73-
--enable=goconst \
74-
--enable=goimports \
75-
--enable=gosimple \
76-
--enable=ineffassign \
77-
--enable=megacheck \
78-
--enable=misspell \
79-
--enable=staticcheck \
80-
--enable=safesql \
81-
--enable=structcheck \
82-
--enable=unconvert \
83-
--enable=unused \
84-
--enable=varcheck \
85-
--enable=vetshadow \
86-
./...
87-
88-
#--enable=maligned \
89-
#--enable=gas \
90-
#--enable=aligncheck \
91-
#--enable=dupl \
92-
#--enable=errcheck \
93-
#--enable=gocyclo \
94-
#--enable=golint \ <== comments on anything exported
95-
#--enable=gotype \
96-
#--enable=interfacer \
97-
#--enable=unparam \
98-
#--enable=vet \
99-
100-
metalinter_all:
101-
protoc $(INCLUDE) --lint_out=. types/*.proto
102-
gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./...
103-
104-
105-
test_golang1.10rc:
106-
docker run -it -v "$(CURDIR):/go/src/github.com/tendermint/go-amino" -w "/go/src/github.com/tendermint/go-amino" golang:1.10-rc /bin/bash -ci "make get_tools all"
64+
# look into .golangci.yml for enabling / disabling linters
65+
lint:
66+
@echo "--> Running linter"
67+
@golangci-lint run
10768

10869
# To avoid unintended conflicts with file names, always add to .PHONY
10970
# unless there is a reason not to.
11071
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
111-
.PHONY: build install check_tools get_tools update_tools get_vendor_deps test fmt metalinter metalinter_all
72+
.PHONY: build install check_tools get_tools fmt lint test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ duplication and help streamline development from inception to maturity.
6666
## Amino in the Wild
6767

6868
* Amino:binary spec in [Tendermint](
69-
https://github.com/tendermint/tendermint/blob/develop/docs/specification/new-spec/encoding.md)
69+
https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/encoding.md)
7070

7171

7272
# Amino Spec

binary_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func TestStructPointerSlice1(t *testing.T) {
204204
var f3 = Foo{
205205
A: "k",
206206
B: 2,
207-
C: []*Foo{&Foo{}, &Foo{}, &Foo{}},
207+
C: []*Foo{{}, {}, {}},
208208
D: "j",
209209
}
210210
bz2, err := cdc.MarshalBinaryLengthPrefixed(f3)
@@ -232,7 +232,7 @@ func TestStructPointerSlice2(t *testing.T) {
232232
bz, err := cdc.MarshalBinaryLengthPrefixed(f)
233233
assert.Error(t, err, "nil elements of a slice/array not supported when empty_elements field tag set.")
234234

235-
f.C = []*Foo{&Foo{}, &Foo{}, &Foo{}}
235+
f.C = []*Foo{{}, {}, {}}
236236
bz, err = cdc.MarshalBinaryLengthPrefixed(f)
237237
assert.NoError(t, err)
238238

go.mod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module github.com/tendermint/go-amino
2+
3+
go 1.12
4+
5+
require (
6+
github.com/davecgh/go-spew v1.1.1
7+
github.com/golang/protobuf v1.3.0
8+
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf
9+
github.com/stretchr/testify v1.3.0
10+
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 // indirect
11+
)

go.sum

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
2+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/golang/protobuf v1.3.0 h1:kbxbvI4Un1LUWKxufD+BiE6AEExYYgkQLQmLFqA1LFk=
6+
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
7+
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
8+
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
9+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
10+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
11+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
12+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
13+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
14+
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
15+
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
16+
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
17+
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
18+
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=

0 commit comments

Comments
 (0)