Skip to content

Commit

Permalink
test: add goleak
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Aug 28, 2023
1 parent 1b8385f commit c9e0f06
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ require (
github.com/urfave/cli/v2 v2.25.0
)

require go.uber.org/goleak v1.2.1 // indirect

require (
github.com/AlecAivazis/survey/v2 v2.3.6
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ github.com/urfave/cli/v2 v2.25.0/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6f
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand Down
16 changes: 16 additions & 0 deletions internal/version/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package version

import (
"fmt"
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
fmt.Println()
fmt.Println("==========================================")
fmt.Println("=========== Start Test: version ==========")
fmt.Println("==========================================")
goleak.VerifyTestMain(m)
}
16 changes: 16 additions & 0 deletions internal/wrapper/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package wrapper

import (
"fmt"
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
fmt.Println()
fmt.Println("==========================================")
fmt.Println("=========== Start Test: wrapper ==========")
fmt.Println("==========================================")
goleak.VerifyTestMain(m)
}
16 changes: 16 additions & 0 deletions pkg/client/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package client

import (
"fmt"
"testing"

"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
fmt.Println()
fmt.Println("==========================================")
fmt.Println("=========== Start Test: client ===========")
fmt.Println("==========================================")
goleak.VerifyTestMain(m)
}

0 comments on commit c9e0f06

Please sign in to comment.