mirror of
https://github.com/directorz/mailfull-go.git
synced 2025-12-17 09:37:02 +00:00
Add missing defer statements #2
This commit is contained in:
@@ -53,6 +53,7 @@ func (r *Repository) AliasDomains() ([]*AliasDomain, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
aliasDomains := make([]*AliasDomain, 0, 10)
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ func (r *Repository) AliasUsers(domainName string) ([]*AliasUser, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
aliasUsers := make([]*AliasUser, 0, 50)
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ func (r *Repository) CatchAllUser(domainName string) (*CatchAllUser, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
scanner := bufio.NewScanner(file)
|
||||
scanner.Scan()
|
||||
|
||||
2
user.go
2
user.go
@@ -169,6 +169,7 @@ func (r *Repository) usersHashedPassword(domainName string) (map[string]string,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
hashedPasswords := map[string]string{}
|
||||
|
||||
@@ -214,6 +215,7 @@ func (r *Repository) userForwards(domainName, userName string) ([]string, error)
|
||||
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
forwards := make([]string, 0, 5)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user