We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
go version
go version go1.11 darwin/amd64
Yes
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"
I attempted to use the gobind tool to generate code for the following example package:
gobind
package bindtest type Number int func DoSomething(i Number) { // do something with i }
I would expect to see the method DoSomething available in the generated code.
DoSomething
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 an int directly rather than a Number.
int
Number
The text was updated successfully, but these errors were encountered:
I actually discovered that custom types do work as long as they use a pointer:
package bindtest type Number int func DoSomething(i *Number) { // do something with i }
Therefore I'm closing this as a duplicate of #27691.
Sorry, something went wrong.
No branches or pull requests
Please answer these questions before submitting your issue. Thanks!
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
)?What did you do?
I attempted to use the
gobind
tool to generate code for the following example package: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:
The binding works, however, if
DoSomething
is updated to take anint
directly rather than aNumber
.The text was updated successfully, but these errors were encountered: