Documentation
¶
Overview ¶
Package zruntime provides utilities to interface with the Go runtime.
Index ¶
Constants ¶
const CGO = true
CGO reports if this is build with cgo.
const Race = false
Race reports if the race detector is enabled.
Variables ¶
This section is empty.
Functions ¶
func GoroutineID ¶
func GoroutineID() uint64
GoroutineID gets the current goroutine ID.
Go doesn't give access to this to discourage certain unwise design patterns, but in some cases it can still be useful; for example for some tests or debugging.
func SizeOf ¶
SizeOf gets the memory size of an object in bytes.
This recurses struct fields and pointers, but there are a few limitations:
Space occupied by code and data reachable through variables captured in the closure of a function pointer are not counted. A value of function type is counted only as a pointer.
Unused buckets of a map cannot be inspected by the reflect package. Their size is estimated by assuming unfilled slots contain zeroes of their type.
Unused capacity of the array underlying a slice is estimated by assuming the unused slots contain zeroes of their type. It is possible they contain non zero values from sharing or reslicing, but without explicitly reslicing the reflect package cannot touch them.
This is adapted from: https://github.com/creachadair/misctools/blob/master/sizeof/size.go
func TestVerbose ¶
func TestVerbose() bool
TestVerbose reports if the test was started with the -v flag.
Types ¶
This section is empty.