diff options
author | Shenghou Ma <minux.ma@gmail.com> | 2014-05-31 00:51:46 -0700 |
---|---|---|
committer | Shenghou Ma <minux.ma@gmail.com> | 2014-05-31 00:51:46 -0700 |
commit | 3ef49272b5efcc31b369c6ca7c6c7701eef0457d (patch) | |
tree | fe6c39719857d68be84ca9395c61800dac575dd3 /src/cmd/cgo | |
parent | 4f5901c7b143961cc495a70feb1930d2b549dfbf (diff) | |
download | go-3ef49272b5efcc31b369c6ca7c6c7701eef0457d.tar.gz |
cmd/cgo: document the cgo types also follow Go name space rules.
Fixes issue 7958.
LGTM=rsc
R=golang-codereviews, rsc, r, gobot
CC=golang-codereviews
https://codereview.appspot.com/91520043
Diffstat (limited to 'src/cmd/cgo')
-rw-r--r-- | src/cmd/cgo/doc.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index 97e4b6af0..69c7ce893 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -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 |