mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
279 B
Go
24 lines
279 B
Go
package bitclear
|
|
|
|
type Flags uint32
|
|
|
|
const (
|
|
FlagA Flags = 1 << iota
|
|
FlagB
|
|
FlagC
|
|
)
|
|
|
|
func bad(f Flags) {
|
|
f &= ^FlagA
|
|
f &= ^(FlagA | FlagB)
|
|
f &= ^ /*comment*/ FlagA
|
|
f &= ^ /*comment*/ (FlagA | FlagB)
|
|
_ = f
|
|
}
|
|
|
|
func good(f Flags) {
|
|
f &^= FlagA
|
|
f &^= FlagA | FlagB
|
|
_ = f
|
|
}
|