Reuse the variable instead of fetching 'name' again

This commit is contained in:
vishalnayak 2016-03-15 16:21:47 -04:00
parent e51661c714
commit cad1ee3a85
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ func (b *backend) pathUserPasswordUpdate(
return nil, fmt.Errorf("missing password")
}
userEntry, err := b.User(req.Storage, strings.ToLower(d.Get("name").(string)))
userEntry, err := b.User(req.Storage, username)
if err != nil {
return nil, err
}

View File

@ -42,7 +42,7 @@ func (b *backend) pathUserPoliciesUpdate(
policies[i] = strings.TrimSpace(p)
}
userEntry, err := b.User(req.Storage, strings.ToLower(d.Get("name").(string)))
userEntry, err := b.User(req.Storage, username)
if err != nil {
return nil, err
}