Skip to content

Commit

Permalink
Add code to be covered by test
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat committed Apr 9, 2024
1 parent 42d0041 commit 8fa82b4
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() {
println("Running PublicAPI.PublicFunc")
println("PublicAPI.PublicMember: ", p.PublicMember)
if PublicMember == 1 {

Check failure on line 24 in dummy.go

View workflow job for this annotation

GitHub Actions / lint / Go

undefined: PublicMember

Check failure on line 24 in dummy.go

View workflow job for this annotation

GitHub Actions / test (1.21) / Go 1.21

undefined: PublicMember

Check failure on line 24 in dummy.go

View workflow job for this annotation

GitHub Actions / test (1.22) / Go 1.22

undefined: PublicMember

Check failure on line 24 in dummy.go

View workflow job for this annotation

GitHub Actions / test (1.22) / Go 1.22

undefined: PublicMember
println("PublicAPI.PublicMember is one")
}
if PublicMember != 1 {

Check failure on line 27 in dummy.go

View workflow job for this annotation

GitHub Actions / lint / Go

undefined: PublicMember (typecheck)

Check failure on line 27 in dummy.go

View workflow job for this annotation

GitHub Actions / test (1.21) / Go 1.21

undefined: PublicMember

Check failure on line 27 in dummy.go

View workflow job for this annotation

GitHub Actions / test (1.22) / Go 1.22

undefined: PublicMember

Check failure on line 27 in dummy.go

View workflow job for this annotation

GitHub Actions / test (1.22) / Go 1.22

undefined: PublicMember
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 8fa82b4

Please sign in to comment.