diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b3e6746..59863e7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,9 +16,10 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.16 - - - name: Build - run: go build -v ./... - - name: Test - run: go test -v ./... \ No newline at end of file + run: go test -race -coverprofile="coverage.txt" -covermode=atomic ./... + + - name: upload coverage + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/utils.go b/utils.go index c061020..520157b 100644 --- a/utils.go +++ b/utils.go @@ -62,7 +62,10 @@ func GetRRSetOrCreate(n NameNodeInterface, rrtype uint16, ttl uint32) RRSetInter func GetRDATA(rr dns.RR) string { v := strings.SplitN(rr.String(), "\t", 5) - return v[5] + if len(v) != 5 { + return "" + } + return v[4] } func MakeRR(r RRSetInterface, rdata string) (dns.RR, error) {