lint: Fixed ineffassign on Add
This commit is contained in:
+2
-5
@@ -17,14 +17,11 @@ var ldapStore = make(LDAPStore)
|
|||||||
type LDAPStore map[string]CachedLDAPpassword
|
type LDAPStore map[string]CachedLDAPpassword
|
||||||
|
|
||||||
// Add caches a password username set.
|
// Add caches a password username set.
|
||||||
func (store *LDAPStore) Add(username, password string) {
|
func (store LDAPStore) Add(username, password string) {
|
||||||
newStore := *store
|
store[username] = CachedLDAPpassword{
|
||||||
newStore[username] = CachedLDAPpassword{
|
|
||||||
Password: password,
|
Password: password,
|
||||||
ExpiresAt: time.Now().Add(time.Hour * 8), // Keep the password valid for 8 hours.
|
ExpiresAt: time.Now().Add(time.Hour * 8), // Keep the password valid for 8 hours.
|
||||||
}
|
}
|
||||||
|
|
||||||
store = &newStore
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsValid checks if a user's password is stored in the cache and checks if a
|
// IsValid checks if a user's password is stored in the cache and checks if a
|
||||||
|
|||||||
Reference in New Issue
Block a user