Extract bits into a int slice from byte slice
问题 I have following byte slice which from which i need to extract bits and place them in a []int as i intend to fetch individual bit values later. I am having a hard time figuring out how to do that. below is my code data := []byte{3 255}//binary representation is for 3 and 255 is 00000011 11111111 what i need is a slice of bits -- > [0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1] What i tried I tried converting byte slice to Uint16 with BigEndian and then tried to use strconv.FormatUint but that fails with