Skip to content

Commit

Permalink
apply new goimports , change travis to go mod
Browse files Browse the repository at this point in the history
  • Loading branch information
hea9549 committed Mar 7, 2019
1 parent 409e562 commit e308005
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 63 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ language: go
# updates. Any older versions be considered deprecated. Don't bother testing
# with them.
go:
- 1.10.x
- 1.11.x

# Enable testing on specific operating system
os:
Expand All @@ -21,14 +21,13 @@ git:

# install additional dependencies required by your project such as Ubuntu packages or custom services
before_install:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- go get golang.org/x/tools/cmd/goimports
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls

# install any dependencies required
install:
- dep ensure
- go mod vendor

# Don't email me the results of the test runs.
notifications:
Expand Down Expand Up @@ -59,4 +58,5 @@ script:

env:
global:
secure: SLwfmMTy7EvBqQxPEmy6ktPEuuFLW7xygv/V639+7fupcklbaSsS2jepjufdWRliX7JDWggy/qJ1QrSwdz671tD4bu2eWPGH9NtZ4d+DtPkMi2/kcyHwTUSGlmzowfLie9dfksgMj7wj7/TXXUbaIibSTyP6UrAbLTeVgsUdBTl59nG98SsFVosCu5PTb9RxtiP2CvWicdpzCM7Go6ySlIHKp7gJAi4Abwtc8uh2tx2HR8LeQQeADl+of6bN+kq43JMfbCRcs8cxlolrdbTYjzO4FvMO/1ZzTcbRfZSihLQaxtzXH5OrWiNHP/FJN+925kgLbA2AFUnLY+XTn2toQnaVMztQGe4pHBExGC/DXFDNGxKH4+0D41ZFXj33NY6RDjAv+WwamBfgKIZwu5IqG0hxEnxtg2jbW/WX1NbxMSnc0bXwmT7wB54GJkYJ8FyjUO2l98yyiZ383UAeG44S78cdhG7U6wL7zfFcR1W9qWKhFokosFuO7DdfTrUXKfbA0SuuqcPXXJdH1qidbPe6JaO5TdOgc+bI1tGWeCjJEGB0yDlThBu+xn4T8OlL4mSmAlBVc+KlYsGxfZqh6q40PUiClLAgow/aeHpZFZg0kWn77vs9gEt4BJL3J6lnTx4sZo5BN19+XHsPeyk8dWt4EZXEvIw/3tMKz17zz10PaDE=
- secure: SLwfmMTy7EvBqQxPEmy6ktPEuuFLW7xygv/V639+7fupcklbaSsS2jepjufdWRliX7JDWggy/qJ1QrSwdz671tD4bu2eWPGH9NtZ4d+DtPkMi2/kcyHwTUSGlmzowfLie9dfksgMj7wj7/TXXUbaIibSTyP6UrAbLTeVgsUdBTl59nG98SsFVosCu5PTb9RxtiP2CvWicdpzCM7Go6ySlIHKp7gJAi4Abwtc8uh2tx2HR8LeQQeADl+of6bN+kq43JMfbCRcs8cxlolrdbTYjzO4FvMO/1ZzTcbRfZSihLQaxtzXH5OrWiNHP/FJN+925kgLbA2AFUnLY+XTn2toQnaVMztQGe4pHBExGC/DXFDNGxKH4+0D41ZFXj33NY6RDjAv+WwamBfgKIZwu5IqG0hxEnxtg2jbW/WX1NbxMSnc0bXwmT7wB54GJkYJ8FyjUO2l98yyiZ383UAeG44S78cdhG7U6wL7zfFcR1W9qWKhFokosFuO7DdfTrUXKfbA0SuuqcPXXJdH1qidbPe6JaO5TdOgc+bI1tGWeCjJEGB0yDlThBu+xn4T8OlL4mSmAlBVc+KlYsGxfZqh6q40PUiClLAgow/aeHpZFZg0kWn77vs9gEt4BJL3J6lnTx4sZo5BN19+XHsPeyk8dWt4EZXEvIw/3tMKz17zz10PaDE=
- GO111MODULE=on
2 changes: 1 addition & 1 deletion hecdsa/ecdsa_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (

"crypto/elliptic"

"github.com/btcsuite/btcutil/base58"
"github.com/DE-labtory/heimdall"
"github.com/btcsuite/btcutil/base58"
)

var ErrKeyType = errors.New("invalid key type - key type should be heimdall.PRIVATEKEY or heimdall.PUBLICKEY")
Expand Down
48 changes: 16 additions & 32 deletions travis/run_on_non_pull_requests
Original file line number Diff line number Diff line change
@@ -1,51 +1,35 @@
#!/bin/bash

# goimports test
diff <(goimports -d $(find . -type f -name '*.go' -not -path "*/vendor/*")) <(printf "")

echo "goimports processing..."
if [ $? -ne 0 ]; then
echo "goimports format error" >&2
exit 1
echo "goimports format error" >&2
exit 1
fi

#echo "go vet processing...."
#go vet -v ./...

#if [ $? -ne 0 ]; then
# echo "go vet fail" >&2
# exit 1
#fi

#echo "golangci-lint run processing...."
#golangci-lint run # run a bunch of code checkers/linters in parallel

#if [ $? -ne 0 ]; then
# echo "golangci-lint fail" >&2
# exit 1
#fi

echo "go test -p 1 -v ./... processing...."
#echo "go test -p 1 -v -race ./... processing...."
go test -p 1 -v ./... # Run all the tests
#go test -p 1 -v -race ./... # Run all the tests with the race detector enabled
# run go test
go test -v -mod=vendor ./...

if [ $? -ne 0 ]; then
echo "go test fail" >&2
exit 1
echo "go test fail" >&2
exit 1
fi

go test -p 1 ./... -covermode=count -coverprofile=coverage.out
#go test -p 1 -race ./... -covermode=count -coverprofile=coverage.out
# generate go test coverage file
go test -v -mod=vendor ./... -covermode=count -coverprofile=coverage.out

if [ $? -ne 0 ]; then
echo "go test coverage fail" >&2
exit 1
echo "go test coverage fail" >&2
exit 1
fi

goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
# notify to coveralls
goveralls -coverprofile=coverage.out -service=travis-ci

if [ $? -ne 0 ]; then
echo "go update test coverage fail" >&2
exit 1
echo "go update test coverage fail" >&2
exit 1
fi

exit 0
37 changes: 11 additions & 26 deletions travis/run_on_pull_requests
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
#!/bin/bash

# goimports test
diff <(goimports -d $(find . -type f -name '*.go' -not -path "*/vendor/*")) <(printf "")

echo "goimports processing..."
if [ $? -ne 0 ]; then
echo "goimports format error" >&2
exit 1
echo "goimports format error" >&2
exit 1
fi

#echo "go vet processing...."
#go vet -v ./...

#if [ $? -ne 0 ]; then
# echo "go vet fail" >&2
# exit 1
#fi

#echo "golangci-lint run processing...."
#golangci-lint run # run a bunch of code checkers/linters in parallel

#if [ $? -ne 0 ]; then
# echo "golangci-lint fail" >&2
# exit 1
#fi

#echo "go test -p 1 -v -race ./... processing...."
echo "go test -p 1 -v ./... processing...."
#go test -p 1 -v -race ./... # Run all the tests with the race detector enabled
go test -p 1 -v ./... # Run all the tests
# run go test
go test -v -mod=vendor ./...

if [ $? -ne 0 ]; then
echo "go test fail" >&2
exit 1
fi
echo "go test fail" >&2
exit 1
fi

exit 0

0 comments on commit e308005

Please sign in to comment.