Documentation ¶
Overview ¶
Package util provides some commonly used functions.
Index ¶
- Constants
- func DeBruijn(k, n byte) (s []byte)
- func Hash(h hash.Hash, f *os.File) (sum []byte, err error)
- func Log4(x float64) float64
- func Max(a ...int) (max int)
- func Min(a ...int) (min int)
- func Pow(base int, exp byte) (r int)
- func Pow4(n int) uint
- func UMax(a ...uint) (max uint)
- func UMin(a ...uint) (min uint)
- type Caller
- type Debug
- type Timer
- type Wrapper
Constants ¶
View Source
const ( MaxUint = ^uint(0) // The maximum uint value. MinUint = uint(0) // The minimum uint value. MaxInt = int(^uint(0) >> 1) // The maximum int value. MinInt = -MaxInt - 1 // The minimum int value. Ln4 = 1.3862943611198906188344642429163531361510002687205105082413 // The natural log of 4. )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
func (*Timer) Reset ¶
func (t *Timer) Reset()
Reset stops the timer and sets the elapsed time to zero.
func (*Timer) Start ¶
func (t *Timer) Start()
Start starts timing. This function is called automatically when a timer is created, but it can also used to resume timing after a call to StopTimer.
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
A Wrapper provides hard line wrapping and output limits to an io.Writer.
func NewWrapper ¶
NewWrapper returns a Wrapper that causes wraps lines at width bytes and limits the number of bytes written to the provided limit.
Click to show internal directories.
Click to hide internal directories.