From 8fa82b4b9b25162d01dc126670e571fd9bcc67f1 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Tue, 9 Apr 2024 10:58:59 +0900 Subject: [PATCH] Add code to be covered by test --- dummy.go | 11 +++++++++++ dummy_test.go | 2 ++ 2 files changed, 13 insertions(+) diff --git a/dummy.go b/dummy.go index 37baf39..9da54ee 100644 --- a/dummy.go +++ b/dummy.go @@ -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 { + println("PublicAPI.PublicMember is one") + } + if PublicMember != 1 { + println("PublicAPI.PublicMember is not one") + } +} diff --git a/dummy_test.go b/dummy_test.go index 95ff4c9..a4d155d 100644 --- a/dummy_test.go +++ b/dummy_test.go @@ -10,4 +10,6 @@ import ( ) func TestDummy(*testing.T) { + p := &PublicAPI{} + p.PublicFunc() }