DataType
C cgo sizeof
--------------------+--------------------+--------------------------------------------
char C.char 1
signed char C.schar 1
unsigned char C.uchar 1
short C.short 2
unsigned short C.ushort 2
int C.int 4
unsigned int C.uint 4
long C.long 4 或 8
unsigned long C.ulong 4 或 8
long long C.longlong 8
unsinged long long C.ulonglong 8
float C.float 4
double C.double 8
void* unsafe.Pointer
Go 学习笔记, 第 4 版
88
char* *C.char
size_t C.size_t
NULL nil