字节取位小技巧

b := make([]byte, 1)
b[0] = 255
fmt.Printf("%b
", b[0]) //11111111

fmt.Printf("%b
", b[0]>>7)//1
fmt.Printf("%b ", (b[0]>>6) & 1)// = 11 & 01 = 1

  

原文地址:https://www.cnblogs.com/flytome/p/9640166.html