From e30f120045b4f823955bd25d71985c813be74e92 Mon Sep 17 00:00:00 2001 From: ShuBo6 <814183583@qq.com> Date: Sun, 7 Jul 2024 13:00:14 +0800 Subject: [PATCH] fix: file.Close() --- cmd/gost/cfg.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/gost/cfg.go b/cmd/gost/cfg.go index dddbdf9..83a8365 100644 --- a/cmd/gost/cfg.go +++ b/cmd/gost/cfg.go @@ -106,6 +106,7 @@ func parseUsers(authFile string) (users []*url.Userinfo, err error) { if err != nil { return } + defer file.Close() scanner := bufio.NewScanner(file) for scanner.Scan() { line := strings.TrimSpace(scanner.Text()) @@ -175,7 +176,7 @@ func parseIP(s string, port string) (ips []string) { } return } - + defer file.Close() scanner := bufio.NewScanner(file) for scanner.Scan() { line := strings.TrimSpace(scanner.Text())