Skip to content

Commit

Permalink
add support send codecov on github action
Browse files Browse the repository at this point in the history
  • Loading branch information
mimuret committed Jul 13, 2021
1 parent 5593555 commit d331fa5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
run: go test -race -coverprofile="coverage.txt" -covermode=atomic ./...

- name: upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 4 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<nil>"
}
return v[4]
}

func MakeRR(r RRSetInterface, rdata string) (dns.RR, error) {
Expand Down

0 comments on commit d331fa5

Please sign in to comment.