File tree 1 file changed +8
-0
lines changed 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -125,11 +125,19 @@ The C types __int128_t and __uint128_t are represented by [16]byte.
125
125
To access a struct, union, or enum type directly, prefix it with
126
126
struct_, union_, or enum_, as in C.struct_stat.
127
127
128
+ The size of any C type T is available as C.sizeof_T, as in
129
+ C.sizeof_struct_stat.
130
+
128
131
As Go doesn't have support for C's union type in the general case,
129
132
C's union types are represented as a Go byte array with the same length.
130
133
131
134
Go structs cannot embed fields with C types.
132
135
136
+ Go code can not refer to zero-sized fields that occur at the end of
137
+ non-empty C structs. To get the address of such a field (which is the
138
+ only operation you can do with a zero-sized field) you must take the
139
+ address of the struct and add the size of the struct.
140
+
133
141
Cgo translates C types into equivalent unexported Go types.
134
142
Because the translations are unexported, a Go package should not
135
143
expose C types in its exported API: a C type used in one Go package
You can’t perform that action at this time.
0 commit comments