nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: go-to-k/delstack
Pull request #231 (2023-08-30 05:12:04)

test: add goleak


Patch:
diff --git a/go.mod b/go.mod
index a1cfe4a..c953205 100644
--- a/go.mod
+++ b/go.mod
@@ -43,6 +43,7 @@ require (
 	github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
 	github.com/russross/blackfriday/v2 v2.1.0 // indirect
 	github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
+	go.uber.org/goleak v1.2.1 // indirect
 	golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
 	golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
 	golang.org/x/text v0.3.8 // indirect
diff --git a/go.sum b/go.sum
index 4db743d..5b5d758 100644
--- a/go.sum
+++ b/go.sum
@@ -105,6 +105,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=


Test patch:
diff --git a/internal/operation/main_test.go b/internal/operation/main_test.go
new file mode 100644
index 0000000..c6c6041
--- /dev/null
+++ b/internal/operation/main_test.go
@@ -0,0 +1,16 @@
+package operation
+
+import (
+	"fmt"
+	"testing"
+
+	"go.uber.org/goleak"
+)
+
+func TestMain(m *testing.M) {
+	fmt.Println()
+	fmt.Println("==========================================")
+	fmt.Println("========== Start Test: operation =========")
+	fmt.Println("==========================================")
+	goleak.VerifyTestMain(m)
+}
diff --git a/internal/version/main_test.go b/internal/version/main_test.go
new file mode 100644
index 0000000..920fad9
--- /dev/null
+++ b/internal/version/main_test.go
@@ -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)
+}
diff --git a/pkg/client/main_test.go b/pkg/client/main_test.go
new file mode 100644
index 0000000..3b92317
--- /dev/null
+++ b/pkg/client/main_test.go
@@ -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)
+}