Documentation ¶
Overview ¶
Package converter 格式, 类型转换包
Index ¶
- Constants
- func ConvertFileSize(size int64, precision ...int) string
- func IntToBool(i int) bool
- func MustInt(s string) (n int)
- func MustInt64(s string) (i int64)
- func ShortDisplay(s string, num int) string
- func SliceInt64ToString(si []int64) (ss []string)
- func SliceStringToInt(ss []string) (si []int)
- func SliceStringToInt64(ss []string) (si []int64)
- func ToBytes(str string) []byte
- func ToString(p []byte) string
Constants ¶
View Source
const ( // B byte B = (int64)(1 << (10 * iota)) // KB kilobyte KB // MB megabyte MB // GB gigabyte GB // TB terabyte TB // PB petabyte PB )
Variables ¶
This section is empty.
Functions ¶
func ConvertFileSize ¶
ConvertFileSize 文件大小格式化输出
func ShortDisplay ¶
ShortDisplay 缩略显示字符串s, 显示长度为num, 缩略的内容用"..."填充
func SliceInt64ToString ¶
SliceInt64ToString []int64 转换为 []string
func SliceStringToInt ¶
SliceStringToInt []string 转换为 []int
func SliceStringToInt64 ¶
SliceStringToInt64 []string 转换为 []int64
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.