github.com/tursom/GoCollections@v0.3.10/unsafe/unsafe_test.go (about) 1 package unsafe 2 3 import ( 4 "fmt" 5 "testing" 6 "unsafe" 7 ) 8 9 func TestAsBytes1(t *testing.T) { 10 i := 1 11 var a any = i 12 bs := AsBytes2(i) 13 fmt.Println(i, bs, AsBytes1(&a), *(*int)(ForceCast[iface](unsafe.Pointer(&a)).data)) 14 }