gf: github.com/gogf/gf/g/util/gutil Index | Files

package gutil

import "github.com/gogf/gf/g/util/gutil"

Package gutil provides utility functions.

Index

Package Files

gutil.go gutil_comparator.go gutil_debug.go

func ComparatorByte Uses

func ComparatorByte(a, b interface{}) int

ComparatorByte provides a basic comparison on byte.

func ComparatorFloat32 Uses

func ComparatorFloat32(a, b interface{}) int

ComparatorFloat32 provides a basic comparison on float32.

func ComparatorFloat64 Uses

func ComparatorFloat64(a, b interface{}) int

ComparatorFloat64 provides a basic comparison on float64.

func ComparatorInt Uses

func ComparatorInt(a, b interface{}) int

ComparatorInt provides a basic comparison on int.

func ComparatorInt16 Uses

func ComparatorInt16(a, b interface{}) int

ComparatorInt16 provides a basic comparison on int16.

func ComparatorInt32 Uses

func ComparatorInt32(a, b interface{}) int

ComparatorInt32 provides a basic comparison on int32.

func ComparatorInt64 Uses

func ComparatorInt64(a, b interface{}) int

ComparatorInt64 provides a basic comparison on int64.

func ComparatorInt8 Uses

func ComparatorInt8(a, b interface{}) int

ComparatorInt8 provides a basic comparison on int8.

func ComparatorRune Uses

func ComparatorRune(a, b interface{}) int

ComparatorRune provides a basic comparison on rune.

func ComparatorString Uses

func ComparatorString(a, b interface{}) int

ComparatorString provides a fast comparison on strings.

func ComparatorTime Uses

func ComparatorTime(a, b interface{}) int

ComparatorTime provides a basic comparison on time.Time.

func ComparatorUint Uses

func ComparatorUint(a, b interface{}) int

ComparatorUint provides a basic comparison on uint.

func ComparatorUint16 Uses

func ComparatorUint16(a, b interface{}) int

ComparatorUint16 provides a basic comparison on uint16.

func ComparatorUint32 Uses

func ComparatorUint32(a, b interface{}) int

ComparatorUint32 provides a basic comparison on uint32.

func ComparatorUint64 Uses

func ComparatorUint64(a, b interface{}) int

ComparatorUint64 provides a basic comparison on uint64.

func ComparatorUint8 Uses

func ComparatorUint8(a, b interface{}) int

ComparatorUint8 provides a basic comparison on uint8.

func Dump Uses

func Dump(i ...interface{})

Dump prints variables <i...> to stdout with more manually readable.

func Export Uses

func Export(i ...interface{}) string

Export returns variables <i...> as a string with more manually readable.

func IsEmpty Uses

func IsEmpty(value interface{}) bool

IsEmpty checks given <value> empty or not. It returns false if <value> is: integer(0), bool(false), slice/map(len=0), nil; or else returns true.

func PrintStack Uses

func PrintStack(skip ...int)

PrintStack prints to standard error the stack trace returned by runtime.Stack.

func Stack Uses

func Stack(skip ...int) string

Stack returns a formatted stack trace of the goroutine that calls it. It calls runtime.Stack with a large enough buffer to capture the entire trace.

func Throw Uses

func Throw(exception interface{})

Throw throws out an exception, which can be caught be TryCatch or recover.

func TryCatch Uses

func TryCatch(try func(), catch ...func(exception interface{}))

TryCatch implements try...catch... logistics.

type Comparator Uses

type Comparator func(a, b interface{}) int

Comparator is a function that compare a and b, and returns the result as int.

Should return a number:

negative , if a < b
zero     , if a == b
positive , if a > b

Package gutil imports 8 packages (graph) and is imported by 2 packages. Updated 2019-07-16. Refresh now. Tools for package owners.