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

Comments

Projects
None yet
4 participants
@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 label Sep 14, 2018

@dmitshur

This comment has been minimized.

Copy link
Member

dmitshur commented Sep 17, 2018

@eliasnaur

This comment has been minimized.

Copy link
Contributor

eliasnaur commented Sep 17, 2018

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