Documentation
¶
Overview ¶
Package demo :: chan.go
Package demo :: foo.go
Package demo :: integer.go
Package demo :: pipe.go
Index ¶
Constants ¶
View Source
const ( // MaxUint represents maximum unsigned integer MaxUint uint = ^(uint(0)) // MaxUint8 represents maximum 8-bit unsigned integer MaxUint8 uint8 = ^(uint8(0)) // MaxUint16 represents maximum 16-bit unsigned integer MaxUint16 uint16 = ^(uint16(0)) // MaxUint32 represents maximum 32-bit unsigned integer MaxUint32 uint32 = ^(uint32(0)) // MaxUint64 represents maximum 64-bit unsigned integer MaxUint64 uint64 = ^(uint64(0)) // MaxInt represents maximum integer MaxInt int = int(^uint(0) >> 1) // int(MaxUint >> 1) // MinInt represents minimum integer MinInt int = ^int(^uint(0) >> 1) // ^MaxInt // MaxInt8 represents maximum 8-bit integer MaxInt8 int8 = int8(^uint8(0) >> 1) // int(MaxUint8 >> 1) // MinInt8 represents minimum 8-bit integer MinInt8 int8 = ^int8(^uint8(0) >> 1) // ^MaxInt8 // MaxInt16 represents maximum 16-bit integer MaxInt16 int16 = int16(^uint16(0) >> 1) // int(MaxUint16 >> 1) // MinInt16 represents minimum 16-bit integer MinInt16 int16 = ^int16(^uint16(0) >> 1) // ^MaxInt16 // MaxInt32 represents maximum 32-bit integer MaxInt32 int32 = int32(^uint32(0) >> 1) // int(MaxUint32 >> 1) // MinInt32 represents minimum 32-bit integer MinInt32 int32 = ^int32(^uint32(0) >> 1) // ^MaxInt32 // MaxInt64 represents maximum 64-bit integer MaxInt64 int64 = int64(^uint64(0) >> 1) // int64(MaxUint64 >> 1) // MinInt64 represents minimum 64-bit integer MinInt64 int64 = ^int64(^uint64(0) >> 1) // ^MaxInt64 )
Variables ¶
This section is empty.
Functions ¶
func Atoi ¶
Atoi converts string to integer Note: 0 for valid decimal number; return max or min on overflow
func DecodeInteger ¶
DecodeInteger decrypts code by length to two integers
func EncodeIntegers ¶
EncodeIntegers crypts two integers by length
func GetMergedChannels ¶
GetMergedChannels merges two channels to one. See https://medium.com/justforfunc/why-are-there-nil-channels-in-go-9877cc0b2308 Notes: in common pattern, each channel (e.g. `ch` as `chan<- int`)
- receives data in a lengthy producer (e.g. `ch <- v`)
- closes at the end of the producer
func MergeChannels ¶
MergeChannels merges inputs to one out channel
Types ¶
Click to show internal directories.
Click to hide internal directories.