From c584f650fa4cbdec05b6729a2f0207aca929c11d Mon Sep 17 00:00:00 2001 From: Anatoly Prohacky Date: Sat, 11 Mar 2023 16:27:53 +1000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20AllBit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acl/aclbit.go | 4 ++++ main.go | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/acl/aclbit.go b/acl/aclbit.go index b2c1abd..1366a50 100644 --- a/acl/aclbit.go +++ b/acl/aclbit.go @@ -8,6 +8,10 @@ import ( type NumBit int64 type AclBit int64 +const ( + AllBit AclBit = 9223372036854775807 +) + // New AclBit func New(n ...NumBit) AclBit { var i64 AclBit diff --git a/main.go b/main.go index 1c8abc8..a38b3e5 100644 --- a/main.go +++ b/main.go @@ -37,5 +37,17 @@ func main() { fmt.Println(a.Verify(62)) a.SetFalse(62) fmt.Println(a.Verify(62)) + + a.SetTrue(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) }