Files
llgo/x/cbind/buf.go

13 lines
195 B
Go
Raw Normal View History

2024-09-04 17:08:08 +08:00
package cbind
import "unsafe"
type slice struct {
data unsafe.Pointer
len int
}
func GoBytes(buf *int8, n int) []byte {
return *(*[]byte)(unsafe.Pointer(&slice{unsafe.Pointer(buf), n}))
}