The following may help:
http://feisky.xyz/2016/04/19/cgo-in-go-1-6/
On 20/03/2017 13:25, Song Liu wrote:
Hi,
I have a shared lib as bellow:
|
/*
#include<stdint.h>
structMedia{
char*Name;
char*Path;
uint64_tSize;
};
*/
import"C"
//exportGetMediaFromDB
funcGetMediaFromDB(filename*C.char)*C.struct_Media{
c_struct_media:=&C.struct_Media{}
returnc_struct_media
}
|
Which is called in another program written by C, but when it's running
it report error:
|
panic:runtime error:cgo result has Gopointer
|
Could you help with the correct way to return a struct from Go ?
Many thanks.
Thanks,
Song
--
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
<mailto:golang-nuts+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
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.