# Functions
fileName:文件名字(带全路径) content: 写入的内容.
get filepath base name.
BytesToMap []byte => map[string]interface{}.
BytesToString byte => string 直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string(Bytes{})的百倍以上,且转换量越大效率优势越明显。.
Clean 清理#注释.
create one file.
No description provided by the author
write append csv files.
get filepath dir name.
list dirs under dirPath.
get file modified time.
get file size as how many bytes.
list files under dirPath.
FileToBytes file => []byte.
FileToMap file => map[string]interface{}.
Format implement Formatter interface map[string]interface{} => struct{} eg: Format(map[string]interface{...}, &Struct{}).
FormatINI format ini.
FormatJSON format json.
FormatXML format xml.
FormatYAML format yaml.
方法二.
方法一.
No description provided by the author
No description provided by the author
判断文件目录是否存在.
MapToBytes map[string]interface{} => []byte.
NewSortMap sortmap.
ParseConfigFile parse config file.
ParseConfigFiles parse config files.
No description provided by the author
remove one file.
No description provided by the author
rename file name.
Round float64四舍五入,并取前几位.
Search a file in paths.
StringToBool string => bool, if fail return false.
StringToBytes string => Bytes 直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string(Bytes{})的百倍以上,且转换量越大效率优势越明显。 转换之后若没做其他操作直接改变里面的字符,则程序会崩溃。 如 b:=String2bytes("xxx"); b[1]='d'; 程序将panic。.
StringToFloat64 string => float64, if fail return 0.
StringToInt string => int, if fail return 0.
StringToInt64 string => int64, if fail return 0.
StringToMap string => map[string]interface{}.
ToBool interface => bool.
ToBytes interface => []byte.
ToFloat64 interface => float64.
ToInt interface => int.
ToInt64 interface => int64.
ToJSON to json.
ToList interface => []interface.
ToMap interface => map[string]interface{}.
ToString interface => string.
ToXML to json.
ToYAML 将结构体in转换成yml格式的字符串, 适用于配置文件落地.
delete file.