Documentation ¶
Index ¶
- Constants
- func Atoa(str interface{}) string
- func Atoi(str interface{}) int
- func Atoui(str interface{}) uint
- func Bytes2String(b []byte) string
- func CheckErr(err error)
- func CheckErrPanic(err error)
- func ExcelSheetNameReplace(fileName string) string
- func FileNameReplace(fileName string) string
- func GetWDPath() string
- func HashString(encode string) uint64
- func IsDirExists(path string) bool
- func IsFileExists(path string) bool
- func IsNum(a string) bool
- func JsonString(obj interface{}) string
- func JsonpToJson(json string) string
- func KeyinsParse(keyins string) []string
- func MakeHash(s string) string
- func MakeMd5(obj interface{}, length int) string
- func MakeUnique(obj interface{}) string
- func Mkdir(Path string)
- func RandomCreateBytes(n int, alphabets ...byte) []byte
- func RelPath(targpath string) string
- func String2Bytes(s string) []byte
- func WalkDir(targpath string, suffixes ...string) (dirlist []string)
- func WalkFiles(targpath string, suffixes ...string) (filelist []string)
- func WalkRelDir(targpath string, suffixes ...string) (dirlist []string)
- func WalkRelFiles(targpath string, suffixes ...string) (filelist []string)
- func XML2mapstr(xmldoc string) map[string]string
Constants ¶
View Source
const (
// Spider中启用Keyin的初始值
USE_KEYIN = "\r\t\n"
)
Variables ¶
This section is empty.
Functions ¶
func Bytes2String ¶
Bytes2String直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string([]byte{})的百倍以上,且转换量越大效率优势越明显。
func CheckErrPanic ¶
func CheckErrPanic(err error)
func ExcelSheetNameReplace ¶
将Excel工作表名中非法字符替换为下划线
func FileNameReplace ¶
func HashString ¶
func IsDirExists ¶
The IsDirExists judges path is directory or not.
func IsFileExists ¶
The IsFileExists judges path is file or not.
func JsonpToJson ¶
JsonpToJson modify jsonp string to json string Example: forbar({a:"1",b:2}) to {"a":"1","b":2}
func RandomCreateBytes ¶
RandomCreateBytes generate random []byte by specify chars.
func String2Bytes ¶
String2Bytes直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string([]byte{})的百倍以上,且转换量越大效率优势越明显。 转换之后若没做其他操作直接改变里面的字符,则程序会崩溃。 如 b:=String2bytes("xxx"); b[1]='d'; 程序将panic。
func WalkRelDir ¶
遍历目录,可指定后缀,返回相对路径
func WalkRelFiles ¶
遍历文件,可指定后缀,返回相对路径
func XML2mapstr ¶
simple xml to string support utf8
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.