build: 更新依赖并添加新库
- 更新 go.mod 和 go.sum 文件,添加多个新库 - 在 LoginSidInfo 结构体中添加注释说明 - 在 cmd.go 中添加 TODO 注释
This commit is contained in:
37
common/serialize/bitset/bitset_test.go
Normal file
37
common/serialize/bitset/bitset_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package bitset
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/pointernil/bitset32"
|
||||
)
|
||||
|
||||
func Test_teset(t *testing.T) {
|
||||
fmt.Printf("! \n")
|
||||
var b bitset32.BitSet32
|
||||
var a bitset32.BitSet32
|
||||
// play some Go Fish
|
||||
// for i := 0; i < 100; i++ {
|
||||
// card1 := uint(rand.Intn(52))
|
||||
// card2 := uint(rand.Intn(52))
|
||||
// b.Set(card1)
|
||||
// if b.Test(card2) {
|
||||
// fmt.Println("Go Fish!")
|
||||
// }
|
||||
// b.Clear(card1)
|
||||
// }
|
||||
|
||||
// Chaining
|
||||
b.Set(10).Set(11)
|
||||
a = *bitset32.New(50)
|
||||
for i, e := b.NextSet(0); e; i, e = b.NextSet(i + 1) {
|
||||
fmt.Println("The b bit is set:", i)
|
||||
}
|
||||
a.Set(10).Set(9)
|
||||
f := b.Union(&a)
|
||||
for i, e := f.NextSet(0); e; i, e = f.NextSet(i + 1) {
|
||||
fmt.Println("The b+ bit is set:", i)
|
||||
}
|
||||
fmt.Println(b.Bytes())
|
||||
}
|
||||
Reference in New Issue
Block a user