#x/mobile do not export some types?

8 messages · Page 1 of 1 (latest)

cloud kelp
#

For gomobile, is there a way to mark some types as not to be exported in android/ios? I have some types needed by RPC that are not compatible with gomobile. Currently there are a bunch of // skipped warnings, but it would be cleaner to mark these as not to try.

rustic night
#

I'm not at all familiar with gomobile, but given that it's a first-party tool, it's possible that it's at least aware of GOOS and GOARCH

#

ios is a valid GOOS, as is android

#

You can also use file suffixes to target specific os/architectures. I'm having a hard time finding good documentation on how to do this, but you can see some examples in the syscall package. If you wanted a specific go file to only build when targeting linux, you could have myfile_linux.go

#

In your specific case, I believe you'd have something like myfile_ios.go and myfile_android.go