Skip to content

Commit

Permalink
fix: file.Close()
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuBo6 committed Jul 7, 2024
1 parent 08c54cd commit e30f120
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 e30f120

Please sign in to comment.