如何将go的类型从uint8转换为unit32?
只需代码:
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)
}
Run Code Online (Sandbox Code Playgroud)
〜> 6g test.go && 6l -o test test.6 &&./ test
test.go:10:无法将uInt8(类型[] uint8)转换为uint32类型