Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
Converts a slice of bytes into a string without performing a copy. NOTE: This is an unsafe operation and may lead to problems if the bytes passed as argument are changed while the string is used. No checking whether bytes are valid UTF-8 data is performed.
func IsInterfaceNil ¶
func IsInterfaceNil(param interface{}) bool
Checks whether an interface is nil or has the value nil.
func StringToBytes ¶
Converts a string into a slice of bytes without performing a copy. NOTE: This is an unsafe operation and may lead to problems if the bytes are changed.
Types ¶
type AtomicBool ¶
type AtomicBool int32
AtomicBool is an atomic Boolean Its methods are all atomic, thus safe to be called by multiple goroutines simultaneously Note: When embedding into a struct, one should always use *AtomicBool to avoid copy
func (*AtomicBool) IsSet ¶
func (ab *AtomicBool) IsSet() bool
IsSet returns whether the Boolean is true
func (*AtomicBool) SetTo ¶
func (ab *AtomicBool) SetTo(yes bool)
SetTo sets the boolean with given Boolean
func (*AtomicBool) SetToIf ¶
func (ab *AtomicBool) SetToIf(old, new bool) (set bool)
SetToIf sets the Boolean to new only if the Boolean matches the old Returns whether the set was done