this can be included from go
return a struct with the data and length of data