]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: document the cgo types also follow Go name space rules.
authorShenghou Ma <minux.ma@gmail.com>
Sat, 31 May 2014 07:51:46 +0000 (00:51 -0700)
committerShenghou Ma <minux.ma@gmail.com>
Sat, 31 May 2014 07:51:46 +0000 (00:51 -0700)
Fixes #7958.

LGTM=rsc
R=golang-codereviews, rsc, r, gobot
CC=golang-codereviews
https://golang.org/cl/91520043

src/cmd/cgo/doc.go

index 97e4b6af06af3598d8a0ab2b94bf71c42b2654d2..69c7ce893c3d1516c8fba1316f3c128c9bbd988a 100644 (file)
@@ -107,6 +107,11 @@ C's union types are represented as a Go byte array with the same length.
 
 Go structs cannot embed fields with C types.
 
+Cgo translates C types into equivalent unexported Go types.
+Because the translations are unexported, a Go package should not
+expose C types in its exported API: a C type used in one Go package
+is different from the same C type used in another.
+
 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 (use _ to skip the result value if the