policy/main.go

56 lines
1021 B
Go
Raw Permalink Normal View History

package main
import (
"fmt"
"gitstore.ru/tolikproh/policy/acl"
)
func main() {
2023-03-04 09:30:21 +02:00
a := acl.New(0, 1, 2, 3, 4, 32, 60, 61, 62, 63)
fmt.Println(a)
2023-03-04 08:58:02 +02:00
fmt.Println(a.String())
fmt.Println(a.Int64())
b := fmt.Sprintf("%b", a)
fmt.Println(b)
2023-03-04 09:30:21 +02:00
fmt.Println(a.Verify(0))
a.SetFalse(0)
fmt.Println(a.Verify(0))
fmt.Println(a.Verify(1))
a.SetFalse(1)
fmt.Println(a.Verify(1))
fmt.Println(a.Verify(2))
a.SetFalse(2)
fmt.Println(a.Verify(2))
fmt.Println(a.Verify(3))
a.SetFalse(3)
fmt.Println(a.Verify(3))
fmt.Println(a.Verify(4))
a.SetFalse(4)
fmt.Println(a.Verify(4))
fmt.Println(a.Verify(5))
a.SetTrue(5)
fmt.Println(a.Verify(5))
fmt.Println(a.Verify(32))
a.SetFalse(32)
fmt.Println(a.Verify(32))
fmt.Println(a.Verify(62))
a.SetFalse(62)
fmt.Println(a.Verify(62))
2023-03-11 08:27:53 +02:00
a.SetTrue(63)
fmt.Println(a.Verify(63))
a.SetFalse(63)
2023-03-04 11:03:57 +02:00
fmt.Println(a.Verify(63))
2023-03-11 08:27:53 +02:00
var ret acl.AclBit
var i acl.NumBit
for i = 0; i < 63; i++ {
ret.SetTrue(i)
}
fmt.Println(ret)
fmt.Println(acl.AllBit)
2023-03-11 10:06:30 +02:00
fmt.Println(16 & 32)
}