diff options
Diffstat (limited to 'vendor/github.com/olahol/melody/session.go')
-rw-r--r-- | vendor/github.com/olahol/melody/session.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/olahol/melody/session.go b/vendor/github.com/olahol/melody/session.go index 879a724d..ad79d54f 100644 --- a/vendor/github.com/olahol/melody/session.go +++ b/vendor/github.com/olahol/melody/session.go @@ -223,6 +223,15 @@ func (s *Session) MustGet(key string) interface{} { panic("Key \"" + key + "\" does not exist") } +// 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 { + delete(s.Keys, key) + } +} + // IsClosed returns the status of the connection. func (s *Session) IsClosed() bool { return s.closed() |