tools

package module
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs added in v0.0.3

func Abs(n int64) int64

Abs 返回绝对值

func FormatStringToFloat

func FormatStringToFloat(s string) (float64, error)

FormatStringToFloat 格式化string为float64

func FormatStringToInt

func FormatStringToInt(s string) (int64, error)

FormatStringToInt 格式化string为int64

func JSONLoad

func JSONLoad(filename string, v interface{}) error

JSONLoad 读取配置

func MD5

func MD5(s string) string

MD5 生成32位md5字串

func Now32

func Now32() int

Now32 获取当前时间戳

func WeekCount

func WeekCount(t time.Time, timeZone int64) int

WeekCount 从0时间戳开始计算,取得当前是第几周(以周一开始算开始,策划要求)

func WeightRand

func WeightRand(data map[int]int) int

WeightRand 从map里根据比率随机一个键值出来

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL