Skip to content

Commit

Permalink
Merge pull request #1038 from ShuBo6/master
Browse files Browse the repository at this point in the history
fix: file.Close()
  • Loading branch information
ginuerzh authored Aug 1, 2024
2 parents de49ba2 + e30f120 commit 48c7970
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/gost/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 48c7970

Please sign in to comment.