Navigation Menu

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: comments in the generated objective-C header depend on which file the function is in #46581

Open
necro351 opened this issue Jun 4, 2021 · 1 comment
Labels
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

@necro351
Copy link

necro351 commented Jun 4, 2021

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

$ go version
go version go1.16.2 darwin/amd64

Does this issue reproduce with the latest release?

I am using golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08
I believe its the latest release.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/rick/Library/Caches/go-build"
GOENV="/Users/rick/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/rick/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/rick/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4g/tb10nky94cxcyrgk2_7bzcch0000gn/T/go-build1988548916=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

When I make an iOS framework to link into my mobile app using this command:

   go build
   gomobile bind -target=iOS

I get a framework that links and works as expected. However, the comments in the generated objective-C header are only included if I make sure all the public functions for the package are in the same file. If I put some public functions in a different file but the same golang package, the functions will be included in the generated header but not the associated comments.

Note that go doc, etc..., all work fine and show the public functions with their comments.

What did you expect to see?

It should not matter which file the public golang function is in or how many files in the package contain public functions. The comments for each function should always be included in the generated header if the function is public and has comments that go doc can see and associate with the function.

What did you see instead?

Some comments are missing if functions are in two or more files.

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Jun 4, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jun 4, 2021
@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 7, 2021
@cherrymui
Copy link
Member

cc @eliasnaur @hyangah

@cherrymui cherrymui changed the title x/mobile: x/mobile: comments in the generated objective-C header depend on which file the function is in Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

3 participants