policy/main.go

43 lines
838 B
Go
Raw 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-04 11:03:57 +02:00
fmt.Println(a.Verify(63))
2023-03-05 10:45:05 +02:00
fmt.Println(a.Verify(64))
}