From 86916b568b8cf7b6d7575fc94397a1bca8bff67d Mon Sep 17 00:00:00 2001 From: diPhantxm Date: Tue, 14 Mar 2023 03:15:26 +0300 Subject: [PATCH] add coverage tests --- .github/workflows/go.yml | 22 +++++++++++++++++++++- core.go | 2 -- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3e21645..ff5d6cd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,4 +16,24 @@ jobs: uses: actions/checkout@v3 - name: Unit Tests - run: go test -v ./... \ No newline at end of file + run: go test -v ./... + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup go + uses: actions/setup-go@v2 + with: + go-version: '1.19' + - name: Setup + run: | + go install github.com/mattn/goveralls@latest + - name: Test + run: | + go test -v ./... -parallel=10 -covermode=count -coverprofile=coverage.out + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + goveralls -coverprofile=coverage.out -service=github \ No newline at end of file diff --git a/core.go b/core.go index c722ca1..e9487c3 100644 --- a/core.go +++ b/core.go @@ -46,8 +46,6 @@ func getDefaultValues(v interface{}) (map[string]string, error) { vType := reflect.TypeOf(v).Elem() vValue := reflect.ValueOf(v).Elem() - //re := regexp.MustCompile(`default:*`) - for i := 0; i < vType.NumField(); i++ { field := vType.Field(i) tag := field.Tag.Get("json")