What's the right way to evaluate nil returned values from Go functions in Android Java?
Here's what I've tried:
// ExportedGoFunction returns a pointer to a GoStruct or nil in case of fail
func ExportedGoFunction() *GoStruct {
return nil
}
Then I generate a .aar file via gomobile using:
gomobile bind -v --target=android
In my Java code I tried to evaluate nil as null but it's not working. Java Code:
GoLibrary.GoStruct goStruct = GoLibrary.ExportedGoFunction();
if (goStruct != null) {
// This block should not be executed, but it is
Log.d("GoLog", "goStruct is not null");
}
Disclaimer: Other methods from the go library work flawless