Documentation ¶
Index ¶
- func BufioRead(name string)
- func CreateDir(_dir string) (err error)
- func FileRead(name string)
- func GetAllFile(path string) (fileName []string, err error)
- func GetRunPath() string
- func GetZeroForToday() (t int64)
- func Ioutil(name string) string
- func Ioutils(name string) string
- func PathExists(path string) bool
- func ReadWithBufByLine(path string) string
- func StringToTimestamp(str string) int64
- func TimeToDateSlice(fromTime, toTime int64) (ts []string)
- func TsToDate(i int64) string
- func WriteByLine(line string, filePath string) (err error)
- func WriteWithBufio(name, content string)
- func WriteWithFileWrite(name, content string)
- func WriteWithIo(name, content string)
- func WriteWithIoutil(name, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllFile ¶
****读文件********************************************************
func main() { Ioutil("mytestfile.txt") OsIoutil("mytestfile.txt") FileRead("mytestfile.txt") BufioRead("mytestfile.txt") GetAllFile("temp/btc_usdt/") ReadWithBufByLine("kline.json") WriteByLine([]string,"temp/btc_usdt/") }
****************************************************************** 获取目录下所有文件
func TimeToDateSlice ¶
把指定的开始和结束时间戳,转换为 日期的数组
func WriteWithFileWrite ¶
func WriteWithFileWrite(name, content string)
使用os.OpenFile()相关函数打开文件对象,并使用文件对象的相关方法进行文件写入操作 清空一次文件
func WriteWithIoutil ¶
使用ioutil.WriteFile方式写入文件,是将[]byte内容写入文件,如果content字符串中没有换行符的话,默认就不会有换行符
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.