Skip to content

Commit

Permalink
Add code to be covered by test
Browse files Browse the repository at this point in the history
To output valid coverage report
  • Loading branch information
at-wat committed Apr 9, 2024
1 parent 977df1e commit 464ab3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ var ErrDummy = errors.New("dummy")
type PublicAPI struct {
PublicMember int
}

func (p *PublicAPI) PublicFunc() {

Check warning on line 21 in dummy.go

View workflow job for this annotation

GitHub Actions / lint / Go

exported: exported method PublicAPI.PublicFunc should have comment or be unexported (revive)
println("Running PublicAPI.PublicFunc")

Check failure on line 22 in dummy.go

View workflow job for this annotation

GitHub Actions / lint / Go

use of `println` forbidden by pattern `^print(ln)?$` (forbidigo)
println("PublicAPI.PublicMember: ", p.PublicMember)

Check failure on line 23 in dummy.go

View workflow job for this annotation

GitHub Actions / lint / Go

use of `println` forbidden by pattern `^print(ln)?$` (forbidigo)
if p.PublicMember == 1 {
println("PublicAPI.PublicMember is one")

Check failure on line 25 in dummy.go

View workflow job for this annotation

GitHub Actions / lint / Go

use of `println` forbidden by pattern `^print(ln)?$` (forbidigo)
}
if p.PublicMember != 1 {
println("PublicAPI.PublicMember is not one")
}
}
2 changes: 2 additions & 0 deletions dummy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ import (
)

func TestDummy(*testing.T) {
p := &PublicAPI{}
p.PublicFunc()
}

0 comments on commit 464ab3e

Please sign in to comment.