Добавление AllBit

This commit is contained in:
Anatoly Prohacky 2023-03-11 16:27:53 +10:00
parent 8c25e5e228
commit c584f650fa
2 changed files with 16 additions and 0 deletions

View File

@ -8,6 +8,10 @@ import (
type NumBit int64 type NumBit int64
type AclBit int64 type AclBit int64
const (
AllBit AclBit = 9223372036854775807
)
// New AclBit // New AclBit
func New(n ...NumBit) AclBit { func New(n ...NumBit) AclBit {
var i64 AclBit var i64 AclBit

12
main.go
View File

@ -37,5 +37,17 @@ func main() {
fmt.Println(a.Verify(62)) fmt.Println(a.Verify(62))
a.SetFalse(62) a.SetFalse(62)
fmt.Println(a.Verify(62)) fmt.Println(a.Verify(62))
a.SetTrue(63)
fmt.Println(a.Verify(63)) fmt.Println(a.Verify(63))
a.SetFalse(63)
fmt.Println(a.Verify(63))
var ret acl.AclBit
var i acl.NumBit
for i = 0; i < 63; i++ {
ret.SetTrue(i)
}
fmt.Println(ret)
fmt.Println(acl.AllBit)
} }