You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
241 B
17 lines
241 B
2 years ago
|
package internal
|
||
|
|
||
|
type Flag uint64
|
||
|
|
||
|
func (flag Flag) Has(other Flag) bool {
|
||
|
return flag&other != 0
|
||
|
}
|
||
|
|
||
|
func (flag Flag) Set(other Flag) Flag {
|
||
|
return flag | other
|
||
|
}
|
||
|
|
||
|
func (flag Flag) Remove(other Flag) Flag {
|
||
|
flag &= ^other
|
||
|
return flag
|
||
|
}
|