Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGO GoInterface #35928

Closed
ghost opened this issue Dec 2, 2019 · 1 comment
Closed

CGO GoInterface #35928

ghost opened this issue Dec 2, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 2, 2019

in my go file:

// Add2 ...
//export Add2
func Add2(i, j int, listener AddListener) {
	listener.addResult(i + j)
}

and run command:

go build  -buildmode=c-shared ./main.go

and generate c header file:

……
// Add2 ...
extern void Add2(GoInt p0, GoInt p1, GoInterface p2);
……

How do I use the GoInterface?

@cagedmantis
Copy link
Contributor

This seems like a question about using cgo. We don't really use our issue tracker for questions. More people will see your question, and you will get better answers, if you ask on a forum rather than on the issue tracker. See https://golang.org/wiki/Questions.

@golang golang locked and limited conversation to collaborators Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants