goutils

package
v0.0.0-...-cb03694 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrParseInt64String

func ArrParseInt64String(b []int64) []string

ArrParseInt64String 转换[]int64为[]string

func ArrParseIntString

func ArrParseIntString(b []int) []string

ArrParseIntString 转换[]int为[]string

func ArrParseStringInt

func ArrParseStringInt(b []string) []int

ArrParseStringInt 转换[]string为[]int

func ArrParseStringInt64

func ArrParseStringInt64(b []string) []int64

ArrParseStringInt64 转换[]string为[]int64

func CheckType

func CheckType(str string, ct string) bool

CheckType 通用输入类型比较

func Date

func Date(timestamp int64, formatArg ...string) string

Date 通过时间戳获取格式 Date(1524799394,"02/01/2006 15:04:05 PM")

func GetRandomInt

func GetRandomInt(n int) string

GetRandomInt 生成随机数字

func GetRandomString

func GetRandomString(n int, more ...bool) string

GetRandomString 生成随机字符串

func InArray

func InArray(need string, needArr []string) bool

InArray 字符串是否在数组中

func InArrayInt

func InArrayInt(need int, needArr []int) bool

InArrayInt int是否在数组中

func InArrayInt64

func InArrayInt64(need int64, needArr []int64) bool

InArrayInt64 int64是否在数组中

func Md5

func Md5(str string) string

Md5 加密

func ParseFloat64ToString

func ParseFloat64ToString(f float64, prec int) string

ParseFloat64ToString 转换浮点数为string

func ParseInt

func ParseInt(b string, defInt int) int

ParseInt string转换int

func ParseInt64String

func ParseInt64String(b string) int64

ParseInt64String string转int64

func ParseString

func ParseString(b int) string

ParseString int转换string

func ParseStringFloat64

func ParseStringFloat64(s string) float64

ParseStringFloat64 转换string为浮点数

func ParseStringInt64

func ParseStringInt64(b int64) string

ParseStringInt64 int64转换string

func RemoveDuplicatesAndEmpty

func RemoveDuplicatesAndEmpty(a []string) (ret []string)

RemoveDuplicatesAndEmpty 数组去重 去空

func Sha1

func Sha1(data string) string

Sha1 加密

func Strtotime

func Strtotime(strtime string, formatArg ...string) (int64, error)

Strtotime 字符串转时间戳 Strtotime("02/01/2016 15:04:05","02/01/2006 15:04:05") == 1451747045 Strtotime("3 04 PM", "8 41 PM") == -62167144740

func Time

func Time() int64

Time 获取当前时间戳

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