First commit

This commit is contained in:
2022-01-13 23:27:39 +01:00
parent dab6549cad
commit f53bf1b804
93 changed files with 11042 additions and 0 deletions

19
pkg/cutils/byteslice.go Normal file
View File

@ -0,0 +1,19 @@
package cutils
import "C"
import (
"reflect"
"unsafe"
)
func ByteSlice(pointer unsafe.Pointer, size int) []byte {
var s []byte
h := (*reflect.SliceHeader)((unsafe.Pointer(&s)))
h.Cap = size
h.Len = size
h.Data = uintptr(pointer)
return s
}