lint: Fixed ineffassign on Add

This commit is contained in:
Daniel Hall
2024-06-26 15:49:41 -07:00
parent 4c5c015190
commit 758c4c7279
+2 -5
View File
@@ -17,14 +17,11 @@ var ldapStore = make(LDAPStore)
type LDAPStore map[string]CachedLDAPpassword
// Add caches a password username set.
func (store *LDAPStore) Add(username, password string) {
newStore := *store
newStore[username] = CachedLDAPpassword{
func (store LDAPStore) Add(username, password string) {
store[username] = CachedLDAPpassword{
Password: password,
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