-
Notifications
You must be signed in to change notification settings - Fork 18k
x/mobile: gomobile bind: add flag to disable package name prefix in iOS classes #32573
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
Comments
Is it not possible to directly use the BTW we chose to include the package names in name generation because in Go, package names are important part of exported names (e.g. Go code uses fmt.Fprintf, not Fprintf), and even choosing the right package name is often discussed in various Go best-practice docs. e.g. https://blog.golang.org/package-names |
I think requiring a prefix (defaulting to the package name) is ok, however being able to completely override it would be nice:
I've found myself in the situation in which I'd like to have different prefix but to do so I've got to rename the |
Is there a solution or work around to this? Android doesn't have this issue? |
Is there a solution around to this? |
Same issue on Android. import lib.Lib
import database.Database In Kotlin and Java we normally use a reverse uri for package names to avoid naming conflicts: import at.crowdware.lib
import at.crowdware.database |
Is there any progress? Now it conflicts with android's code generation strategy. In Android, the imported client doesn't have prefix while iOS has. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhen binding an iOS framework with:
gomobile bind -target ios some-package
in generated header files all classes DO have prefix of package name. I tried using
-prefix
flag, but it adds even additional prefix to class names.I need a way to remove package name prefix, so the class name remain exactly the same as in Go code.
The text was updated successfully, but these errors were encountered: