You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by ti...@apache.org on 2022/09/20 02:06:32 UTC

[incubator-kvrocks] branch unstable updated: fix: file should be closed in gocase StartServer func (#892)

This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new fc09059  fix: file should be closed in gocase StartServer func (#892)
fc09059 is described below

commit fc09059083304f922ce74f6fbaa368aa27777406
Author: ColinChamber <95...@users.noreply.github.com>
AuthorDate: Tue Sep 20 10:06:26 2022 +0800

    fix: file should be closed in gocase StartServer func (#892)
---
 tests/gocase/util/server.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/gocase/util/server.go b/tests/gocase/util/server.go
index d0ab1b7..136e60a 100644
--- a/tests/gocase/util/server.go
+++ b/tests/gocase/util/server.go
@@ -82,6 +82,7 @@ func StartServer(t testing.TB, configs map[string]string) *KvrocksServer {
 
 	f, err := os.Create(filepath.Join(dir, "kvrocks.conf"))
 	require.NoError(t, err)
+	defer func() { require.NoError(t, f.Close()) }()
 
 	for k := range configs {
 		_, err := f.WriteString(fmt.Sprintf("%s %s\n", k, configs[k]))