Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/cgo: error in example #5095
The docs at http://golang.org/cmd/cgo/ say: --- Any C function that returns a value may be called in a multiple assignment context to retrieve both the return value and the C errno variable as an error. For example: n, err := C.atoi("abc") --- This has two errors: 1. Need to wrap "abc" in C.CString 2. atoi does not set errno (at least on Linux), strtol does I suggest to change the example to // Will generate error since base 100 is too large n, err := C.strtol(C.CString("10"), nil, 100)
This issue was closed.