-
Notifications
You must be signed in to change notification settings - Fork 677
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: adshao <tjusgj@gmail.com> Signed-off-by: adshao <tjusgj@gmail.com>
- Loading branch information
Showing
5 changed files
with
85 additions
and
28 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
UnitTest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: './v2/go.mod' | ||
cache: true | ||
cache-dependency-path: './v2/go.sum' | ||
- name: Format | ||
run: ./check.sh format | ||
- name: Vet | ||
run: ./check.sh vet | ||
- name: UnitTest | ||
run: ./check.sh unittest |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
ACTION=$1 | ||
|
||
function format() { | ||
echo "Running gofmt ..." | ||
if [[ $1 == "-w" ]]; then | ||
gofmt -w $(find . -type f -name '*.go' -not -path "./vendor/*") | ||
elif [[ $1 == "-l" ]]; then | ||
gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*") | ||
else | ||
test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" | ||
fi | ||
} | ||
|
||
function lint() { | ||
echo "Running golint ..." | ||
go install golang.org/x/lint/golint | ||
golint -set_exit_status ./... | ||
} | ||
|
||
function vet() { | ||
echo "Running go vet ..." | ||
( | ||
cd v2 | ||
go vet ./... | ||
) | ||
} | ||
|
||
function unittest() { | ||
echo "Running go test ..." | ||
( | ||
cd v2 | ||
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
) | ||
} | ||
|
||
if [[ -z $ACTION ]]; then | ||
format | ||
# lint | ||
vet | ||
unittest | ||
else | ||
shift | ||
$ACTION "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
module github.com/adshao/go-binance/v2 | ||
|
||
go 1.13 | ||
go 1.18 | ||
|
||
require ( | ||
github.com/bitly/go-simplejson v0.5.0 | ||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect | ||
github.com/gorilla/websocket v1.5.0 | ||
github.com/json-iterator/go v1.1.12 | ||
github.com/kr/pretty v0.2.0 // indirect | ||
github.com/stretchr/testify v1.4.0 | ||
) | ||
|
||
require ( | ||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/kr/pretty v0.2.0 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/stretchr/objx v0.1.0 // indirect | ||
gopkg.in/yaml.v2 v2.2.2 // indirect | ||
) |