Browse Source
Merge pull request #1038 from ShuBo6/master
fix: file.Close()
pull/1045/head
ginuerzh
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
1 deletions
-
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()) |
|
|
|
|