Documentation ¶
Index ¶
- Constants
- Variables
- func ByteReplace(s, old, new []byte, n int) []byte
- func BytesToString(b []byte) string
- func CopyMap(originMap map[string]interface{}) map[string]interface{}
- func Float64Cut(f float64, prec int) float64
- func Float64Round(f float64, prec int) float64
- func GenerateId() int64
- func GetFirstNotEmptyString(items ...string) string
- func GetGOPATH() string
- func Int64ToString(input int64) string
- func IsDir(path string) bool
- func IsNil(src interface{}) bool
- func RandomPassword(pwdLength int, pwdCodes ...byte) string
- func RandomStrings(length int, from string) string
- func SliceCut(v interface{}, offset int, limit int) error
- func Stack(skip int) []byte
- func StorageUnitConvert(bytes uint64, unitMap ...map[float32]string) string
- func StringArrayContains(s []string, e string) bool
- func StringArrayDiff(m, n []string) []string
- func StringArrayUnique(m []string) []string
- func StringContainsOne(src string, items ...string) bool
- func StringReplace(base, oldS, newS string, n int) string
- func StringToBytes(s string) []byte
- func StringsToInterfaces(src []string) []interface{}
- func ToCamel(s string) string
- func ToDelimited(s string, del uint8) string
- func ToInt64(value interface{}) (d int64)
- func ToKebab(s string) string
- func ToLowerCamel(s string) string
- func ToScreamingDelimited(s string, del uint8, screaming bool) string
- func ToScreamingKebab(s string) string
- func ToScreamingSnake(s string) string
- func ToSnake(s string) string
- func TrimBlankLines(text string) string
- func XMLDecode(data []byte, obj interface{}) error
- func XMLEncode(obj interface{}) ([]byte, error)
Constants ¶
const ( BYTE = 1.0 KILOBYTE = 1024 * BYTE MEGABYTE = 1024 * KILOBYTE GIGABYTE = 1024 * MEGABYTE TERABYTE = 1024 * GIGABYTE )
Variables ¶
Functions ¶
func ByteReplace ¶
func BytesToString ¶
BytesToString converts byte slice to string.
func Float64Cut ¶
func GetFirstNotEmptyString ¶
func Int64ToString ¶
func RandomPassword ¶
RandomPassword 生成随机密码 pwdLength 为密码长度,pwdCodes为密码生成字符范围,不传使用默认值
func RandomStrings ¶
func StorageUnitConvert ¶
func StringArrayContains ¶
Deprecated, use github.com/duke-git/lancet/v2/slice instead.
func StringArrayDiff ¶
Deprecated, use github.com/duke-git/lancet/v2/slice instead.
func StringArrayUnique ¶
Deprecated, use github.com/duke-git/lancet/v2/slice instead.
func StringContainsOne ¶
Deprecated, use github.com/duke-git/lancet/v2/slice instead.
func StringReplace ¶
func StringToBytes ¶
StringToBytes converts string to byte slice.
func StringsToInterfaces ¶
func StringsToInterfaces(src []string) []interface{}
func ToDelimited ¶
Converts a string to delimited.snake.case (in this case `del = '.'`)
func ToScreamingDelimited ¶
Converts a string to SCREAMING.DELIMITED.SNAKE.CASE (in this case `del = '.'; screaming = true`) or delimited.snake.case (in this case `del = '.'; screaming = false`)
func ToScreamingKebab ¶
Converts a string to SCREAMING-KEBAB-CASE
func ToScreamingSnake ¶
Converts a string to SCREAMING_SNAKE_CASE
Types ¶
This section is empty.