#x/mobile do not export some types?
8 messages · Page 1 of 1 (latest)
Have you tried using build tags?
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
This looks pretty good
https://www.digitalocean.com/community/tutorials/building-go-applications-for-different-operating-systems-and-architectures