Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(data []byte) map[string]interface{}
- func Decoder(data []byte, v interface{})
- func DeleteArray(array []uint32, index int) []uint32
- func DeleteStringArray(array []string, index int) []string
- func DirSizeB(path string) int64
- func Encode(data interface{}) []byte
- func Encoder(data interface{}) []byte
- func ExecTime(fn func()) float64
- func ExecTimeWithError(fn func() error) (float64, error)
- func FindByExp(str interface{}, exp_str string) bool
- func GenerateRandomString(length int) (string, error)
- func Map2String(m map[string]interface{}, has_key bool) string
- func Map2Strings(m map[string]interface{}, has_key bool) []string
- func MergeMap(elem1, elem2 map[string]interface{}) map[string]interface{}
- func Murmur3(key []byte) (hash uint32)
- func Now() string
- func Obj2Map(obj any) map[string]interface{}
- func Printc(format string, color string, a ...interface{})
- func Printf(format string, a ...interface{})
- func Println(a ...interface{})
- func QuickSortAsc(arr []int, start, end int, cmp func(int, int))
- func ReleaseAssets(file fs.File, out string)
- func RemoveDuplicates(input []string) []string
- func RemoveHTMLTags(s string) string
- func RemovePunctuation(str string) string
- func RemoveSpace(str string) string
- func Sha1Hash(text string) string
- func StringToInt(value string) uint32
- func UUID() string
- func Uint32Comparator(a, b interface{}) int
- func Uint32ToBytes(i uint32) []byte
- func Uint64ToBytes(n uint64) []byte
Constants ¶
View Source
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" )
定义一些ANSI转义码的颜色常量
Variables ¶
View Source
var DEBUG = true
View Source
var (
Seed = uint32(1)
)
Functions ¶
func DeleteArray ¶
func DeleteStringArray ¶
func ExecTimeWithError ¶
func GenerateRandomString ¶
GenerateRandomString 生成固定长度的随机字符串 length 是期望的字符串长度 注意:由于我们使用了hex编码,实际生成的随机字节长度需要是目标字符串长度的一半(向上取整)
func Map2String ¶
func Map2Strings ¶
func QuickSortAsc ¶
QuickSortAsc 快速排序
func ReleaseAssets ¶
func RemoveDuplicates ¶
RemoveDuplicates 去除字符串slice中的重复项,返回不含重复项的新slice 参数input: 需要去重的字符串slice 返回值: 去除重复项后的字符串slice
func Uint32Comparator ¶
func Uint32Comparator(a, b interface{}) int
func Uint32ToBytes ¶
func Uint64ToBytes ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.