我正在嘗試將固定大小的數組轉換[32]byte為可變大小的數組(切片)[]byte:package mainimport ( "fmt")func main() { var a [32]byte b := []byte(a) fmt.Println(" %x", b)}但編譯器拋出錯誤:./test.go:9: cannot convert a (type [32]byte) to type []byte我應該如何轉換它?
- 2 回答
- 0 關注
- 173 瀏覽
添加回答
舉報
0/150
提交
取消