In a fork of this when it was essentially abandoned someone contributed concurrency safety in a PR.
This also had the session.UnSet() function
// UnSet will delete the key and has no return value
func (s *Session) UnSet(key string) {
s.rwmutex.Lock()
defer s.rwmutex.Unlock()
if s.keys != nil {
_, exists := s.keys[key]
if exists {
delete(s.keys, key)
}
}
}
Would you be willing to add this?
Because if you set e.g. a string to "" it's still set, the value is "" but when it's not in the keys, you get what I mean.
p.s. correction, it was me who added that :D so, no copyright issue there.
Altough this is probably better
// UnSet will delete the key and has no return value
func (s *Session) UnSet(key string) {
s.rwmutex.Lock()
defer s.rwmutex.Unlock()
if s.Keys != nil {
_, exists := s.Keys[key]
if exists {
delete(s.Keys, key)
}
}
}
In a fork of this when it was essentially abandoned someone contributed concurrency safety in a PR. This also had the session.UnSet() function
Would you be willing to add this?
Because if you set e.g. a string to "" it's still set, the value is "" but when it's not in the keys, you get what I mean. p.s. correction, it was me who added that :D so, no copyright issue there.
Altough this is probably better
(Keys is pubic now)