Sizeof struct in Go
Roger already showed how to use SizeOf method from the unsafe package. Make sure you read this before relying on the value returned by the function: The size does not include any memory possibly referenced by x. For instance, if x is a slice, Sizeof returns the size of the slice descriptor, not the size … Read more