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/bind: C functions in headers should not be PascalCase #58480

Open
shamilovtim opened this issue Feb 12, 2023 · 5 comments
Open

x/mobile/bind: C functions in headers should not be PascalCase #58480

shamilovtim opened this issue Feb 12, 2023 · 5 comments
Labels
FeatureRequest help wanted mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@shamilovtim
Copy link

What version of Go are you using (go version)?

go version go1.17.6 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
GO111MODULE="auto"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/admin/Library/Caches/go-build"
GOENV="/Users/admin/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/admin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/admin/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.6"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/admin/Documents/Development/block/ssi-sdk-mobile/sdk/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wh/3w785sdn0dj57ljs45b_70dc0000gn/T/go-build1910036593=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

When using go bind ios in our project we are getting everything coming through as PascalCase. This is irritating because it's standard for methods and functions to be camelCase, classes to be PascalCase, and so on. But instead go bind ios seems to treat everything as PascalCase whether it's a class, function, method, variable, interface or anything else.
Screenshot 2023-02-11 at 10 58 40 PM

At a minimum go bind ios and go bind android should adopt best practices for casing.

What did you expect to see?

Classes: PascalCase, methods: camelCase, constants or enums: UPPERCASE, variables: camelCase.

What did you see instead?

Everything is PascalCase

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Feb 12, 2023
@gopherbot gopherbot added this to the Unreleased milestone Feb 12, 2023
@shamilovtim
Copy link
Author

Related: #12889

@prattmic
Copy link
Member

cc @hyangah

@prattmic prattmic added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 14, 2023
@hyangah
Copy link
Contributor

hyangah commented Feb 14, 2023

Following the best practice of the target language is ideal, but I am afraid changing this now can cause a lot of churns.
Should consider an option.
Or, alternatively, forking x/mobile is another option - as many of you noticed, dev work in x/mobile is not active.

@shamilovtim
Copy link
Author

I think a breaking change during compilation is ok though? To get this change users would have to update x/mobile/bind so they'd be consenting to receiving changes?

If not, then a CLI option would be ok. go bind ios -casing old (default) or go bind ios -casing improved

@decentralgabe
Copy link

@hyangah is there a roadmap or plan for x/mobile? Can we expect it to become active in the future?

Asking because we're aiming to make critical pieces of our infrastructure rely on go mobile. If it won't be supported we must explore other options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest help wanted mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants