Documentation ¶
Overview ¶
Package bytesizes provides constants with the size in bytes of numeric types.
Index ¶
Constants ¶
View Source
const ( Int = uint64(unsafe.Sizeof(int(0))) Uint = uint64(unsafe.Sizeof(uint(0))) Uintptr = uint64(unsafe.Sizeof(uintptr(0))) Bool = uint64(unsafe.Sizeof(bool(false))) Int8 = uint64(unsafe.Sizeof(int8(0))) Int16 = uint64(unsafe.Sizeof(int16(0))) Int32 = uint64(unsafe.Sizeof(int32(0))) Int64 = uint64(unsafe.Sizeof(int64(0))) Uint8 = uint64(unsafe.Sizeof(uint8(0))) Uint16 = uint64(unsafe.Sizeof(uint16(0))) Uint32 = uint64(unsafe.Sizeof(uint32(0))) Uint64 = uint64(unsafe.Sizeof(uint64(0))) Float32 = uint64(unsafe.Sizeof(float32(0))) Float64 = uint64(unsafe.Sizeof(float64(0))) Complex64 = uint64(unsafe.Sizeof(complex64(0))) Complex128 = uint64(unsafe.Sizeof(complex128(0))) Byte = Uint8 Rune = Int32 )
Constants for the byte size of each Go numeric type.
Variables ¶
View Source
var Kind = map[reflect.Kind]uint64{ reflect.Int: Int, reflect.Uint: Uint, reflect.Uintptr: Uintptr, reflect.Bool: Bool, reflect.Int8: Int8, reflect.Int16: Int16, reflect.Int32: Int32, reflect.Int64: Int64, reflect.Uint8: Uint8, reflect.Uint16: Uint16, reflect.Uint32: Uint32, reflect.Uint64: Uint64, reflect.Float32: Float32, reflect.Float64: Float64, reflect.Complex64: Complex64, reflect.Complex128: Complex128, }
Kind maps each numeric reflect.Kind to the number of bytes it takes. Non-numeric kinds and aliases are not included.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.