]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: fix the cgo example on multiple assignment context.
authorMiki Tebeka <miki.tebeka@gmail.com>
Fri, 22 Mar 2013 03:06:25 +0000 (20:06 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Mar 2013 03:06:25 +0000 (20:06 -0700)
Change from atoi to strtol since atoi does not set errno.

R=golang-dev, minux.ma, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7888047

src/cmd/cgo/doc.go

index 3893f7deb592ddd2768fe3b78c29286c5e69d51b..efbeae958802333329c3540049548673ef41575e 100644 (file)
@@ -70,7 +70,7 @@ assignment context to retrieve both the return value (if any) and the
 C errno variable as an error (use _ to skip the result value if the
 function returns void).  For example:
 
-       n, err := C.atoi("abc")
+       n, err := C.sqrt(-1)
        _, err := C.voidFunc()
 
 In C, a function argument written as a fixed size array