From 3418d100ab9d90b6199031bbf3d963ead7aae406 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 26 Apr 2024 20:57:46 +0800 Subject: [PATCH] fix: close file Signed-off-by: guoguangwu --- pkg/shark/wiresharkcfg/cfg.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/shark/wiresharkcfg/cfg.go b/pkg/shark/wiresharkcfg/cfg.go index 59bcb7d..ca31240 100644 --- a/pkg/shark/wiresharkcfg/cfg.go +++ b/pkg/shark/wiresharkcfg/cfg.go @@ -55,6 +55,7 @@ func (c *Config) PopulateFrom(filename string) error { if err != nil { return err } + defer file.Close() parsed, err := ParseReader("", file) if err != nil { return err