Closed
Description
package main
import "C"
import "fmt"
func main() {
var cp *C.uchar
var gop *uint8 = cp
fmt.Println(gop)
var carr [1]C.uchar
var goarr [1]uint8 = carr
fmt.Println(goarr)
}
Trying to run it:
./main.go:9: cannot use cp (type *C.unsignedchar) as type *uint8 in assignment
./main.go:13: cannot use carr (type [1]C.unsignedchar) as type [1]uint8 in assignment
If I run go tool cgo -godefs
it generates a Go file that looks and runs fine:
...
func main() {
var cp *uint8
var gop *uint8 = cp
fmt.Println(gop)
var carr [1]uint8
var goarr [1]uint8 = carr
fmt.Println(goarr)
}
Not sure whether this is the same issue as #13635 that I also reported a few days ago and has been fixed.
Is it possible to land a fix for the above in 1.5.x please?