Hi theres, I used unsafe.Pointer to conv Type [3]int to Type []int, But it throws a runtime error, Could anybody tell me why? many thanks. The test code is as follows:
package main import ( "fmt" "unsafe" ) func main() { a := [3]int{1, 2, 3} b := *(*[]int)(unsafe.Pointer(&a)) fmt.Println(b) } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.