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 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 SliceStringToInt64 ¶
SliceStringToInt64 []string 转换为 []int64
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.