Como converter [4] uint8 em uint32 no Go?
omo converter o tipo de go de uint8 para unit3
Apenas o código:
package main
import (
"fmt"
)
func main() {
uInt8 := []uint8{0,1,2,3}
var uInt32 uint32
uInt32 = uint32(uInt8)
fmt.Printf("%v to %v\n", uInt8, uInt32)
}
~> 6g test.go && 6l -o test test.6 && ./tes
test.go: 10: não é possível converter uInt8 (digite [] uint8) para digitar uint32