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/cmd/gobind: non-pointer struct types not supported in parameter or return values #27691

Open
dradtke opened this issue Sep 14, 2018 · 2 comments
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

@dradtke
Copy link

dradtke commented Sep 14, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN="/Users/dradtke/Workspace/go/bin"
GOCACHE="/Users/dradtke/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dradtke/Workspace/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/w1/f3bh6jkx0vx95g4885d2yr5h3kfr1q/T/go-build388664200=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I attempted to use the gobind tool to generate code for the following example package:

package bindtest

type Param struct {
        Value string
}

func DoSomething(p Param) {
        // do something with param
}

What did you expect to see?

I would expect to see the method DoSomething available in the generated code.

What did you see instead?

The function gets skipped due to an invalid parameter type:

$ gobind -lang go bindtest | grep DoSomething
// skipped function DoSomething with unsupported parameter or result types

The binding works, however, if DoSomething is updated to take a pointer to Param.

@gopherbot gopherbot added this to the Unreleased milestone Sep 14, 2018
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Sep 14, 2018
@dmitshur
Copy link
Contributor

/cc @eliasnaur @hyangah per owners.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 17, 2018
@eliasnaur
Copy link
Contributor

Indeed. Noone has gotten around to adding value types yet.

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

4 participants