This commit is contained in:
Shivaram Lingamneni 2018-05-22 04:23:33 -04:00
parent f142bf065d
commit 0751f52f37
1 changed files with 4 additions and 0 deletions

View File

@ -340,6 +340,10 @@ func NewModeSet() *ModeSet {
// test whether `mode` is set
func (set *ModeSet) HasMode(mode Mode) bool {
if set == nil {
return false
}
set.RLock()
defer set.RUnlock()
return set.modes[mode]