change v0.0.1
This commit is contained in:
parent
96c0cdabbf
commit
894bc6617c
@ -73,11 +73,8 @@ func (a AclBit) String() string {
|
||||
// converting string bits to int64
|
||||
func (a AclBit) Int64() int64 {
|
||||
|
||||
i64, err := strconv.ParseInt(a.String(), 2, 64)
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
return i64
|
||||
return int64(a)
|
||||
|
||||
}
|
||||
|
||||
// converting string bits to int64
|
||||
|
3
go.mod
3
go.mod
@ -2,9 +2,10 @@ module gitstore.ru/tolikproh/policy
|
||||
|
||||
go 1.18
|
||||
|
||||
require github.com/stretchr/testify v1.8.0
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/stretchr/testify v1.8.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
1
go.sum
1
go.sum
@ -8,6 +8,7 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
5
main.go
5
main.go
@ -9,9 +9,8 @@ import (
|
||||
func main() {
|
||||
a := acl.New(63, 63, 63, 3, 62, 62, 64, 64, 5654, 5435, -12234)
|
||||
fmt.Println(a)
|
||||
str := acl.String(a)
|
||||
fmt.Println(str)
|
||||
fmt.Println(acl.Int64(str))
|
||||
fmt.Println(a.String())
|
||||
fmt.Println(a.Int64())
|
||||
b := fmt.Sprintf("%b", a)
|
||||
fmt.Println(b)
|
||||
fmt.Println(acl.Verify(a, 63))
|
||||
|
Loading…
Reference in New Issue
Block a user