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

x/mobile: Is it possible to send a function as argument from Java to golang? #67136

Closed
sourish115 opened this issue May 2, 2024 · 1 comment
Labels
mobile Android, iOS, and x/mobile
Milestone

Comments

@sourish115
Copy link

I am using gomobile bind to generate binding for android. I have a use case where I want to write and export a function in golang which takes in a simple function as an argument like so:
func SetCallback(cb Callback)
where Callback is a user defined type:
type Callback func(string)
However gomobile bind is not able to generate java bindings for this function. I have tried to do this directly without defining a Callback type, but no success. Is there any other way to do this?
Thank you for your time, looking forward to your response.

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label May 2, 2024
@gopherbot gopherbot added this to the Unreleased milestone May 2, 2024
@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

3 participants