I am trying to create a shared library (libname.so) in golang using following command
go build -buildmode c-shared -o testlib.so test.go where test.go contains below code
package main
import “C”
type person struct {
name string
age int
}
//export newPerson
func newPerson(name string) *person {
p := person{name: name}
p.age = 42
return &p
}
func main(){}
It’s giving an error “Go type not supported in export: struct”
Can someone help?