Documentation ¶
Index ¶
- Variables
- func DataSize(size uint64) string
- func ElapsedTime(startTime time.Time) string
- func Float(in interface{}) (float64, error)
- func HowLongAgo(sec int64) string
- func Int(in interface{}) (int, error)
- func Int64(in interface{}) (int64, error)
- func IsNumeric(c byte) bool
- func MustFloat(in interface{}) float64
- func MustInt(in interface{}) int
- func MustInt64(in interface{}) int64
- func MustUint(in interface{}) uint64
- func Percent(val, total int) float64
- func RandomInt(min, max int) int
- func ToFloat(in interface{}) (f64 float64, err error)
- func ToInt(in interface{}) (iVal int, err error)
- func ToInt64(in interface{}) (i64 int64, err error)
- func ToUint(in interface{}) (u64 uint64, err error)
- func Uint(in interface{}) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrConvertFail = errors.New("convert data type is failure")
)
Functions ¶
func ElapsedTime ¶
ElapsedTime calc elapsed time 计算运行时间消耗 单位 ms(毫秒)
func IsNumeric ¶ added in v0.3.12
IsNumeric returns true if the given character is a numeric, otherwise false.
func MustFloat ¶ added in v0.2.2
func MustFloat(in interface{}) float64
MustFloat convert value to float64
func MustUint ¶ added in v0.2.2
func MustUint(in interface{}) uint64
MustUint convert string to uint
func RandomInt ¶ added in v0.3.6
RandomInt return an random int at the min ~ max Usage:
RandomInt(10, 99) RandomInt(100, 999) RandomInt(1000, 9999)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.