-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
cmd/cgo: multiple assignment to get errno value does not work with 'var' #13930
Labels
Milestone
Comments
ianlancetaylor
changed the title
cgo/errno - multiple assignment does not work with 'var'
cmd/cgo: multiple assignment to get errno value does not work with 'var'
Jan 13, 2016
CL https://golang.org/cl/18623/ mentions this issue. |
CL https://golang.org/cl/18623 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
According to the cgo documentation: "Any C function (even void functions) may be called in a multiple assignment context to retrieve both the return value (if any) and the C errno variable as an error"
I was expecting
var res, err = C.sqrt(1)
to work but onlyres, err := C.sqrt(1)
works.var res, err = C.sqrt(1)
fails at compile time with "assignment count mismatch: 2 = 1"go version go1.6beta1 linux/amd64
Operating System (Virtual Box Guest): Linux 3.16.0-4-amd64 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14) x86_64 GNU/Linux
Ref golang-nuts: https://groups.google.com/forum/#!topic/golang-nuts/g88yZMHL_A0
main.go
The text was updated successfully, but these errors were encountered: