Remove useless comments

This commit is contained in:
iyear 2021-06-18 19:36:13 +08:00
parent cc0440055a
commit b9171867f6
4 changed files with 4 additions and 6 deletions

View File

@ -30,7 +30,7 @@ const (
func BotStart() { func BotStart() {
var err error var err error
fmt.Println(logo) fmt.Printf("%s\n", logo)
//read config //read config
config.InitConfig() config.InitConfig()
//Init Logger //Init Logger

View File

@ -189,7 +189,7 @@ func bExport(m *tb.Message) {
MIME: "text/plain", MIME: "text/plain",
} }
bot.Send(m.Chat, exportFile) bot.Send(m.Chat, exportFile)
//不遗留本地文件
if exportFile.InCloud() != true || os.Remove(fileName) != nil { if exportFile.InCloud() != true || os.Remove(fileName) != nil {
zap.S().Errorw("failed to export files") zap.S().Errorw("failed to export files")
} }

View File

@ -182,7 +182,7 @@ func (c *Client) GetOutlookMails() error {
if err != nil { if err != nil {
return err return err
} }
//fmt.Println(string(content))
//这里的.需要转义,否则会按路径的方式解析 //这里的.需要转义,否则会按路径的方式解析
if gjson.Get(string(content), "@odata\\.context").String() != "" { if gjson.Get(string(content), "@odata\\.context").String() != "" {
return nil return nil

View File

@ -57,13 +57,12 @@ func GetPathFiles(path string) []string {
return t return t
} }
// GetRecentLogs 输入文件夹路径返回最近n个log的路径不到n个返回所有
func GetRecentLogs(path string, n int) []string { func GetRecentLogs(path string, n int) []string {
var paths []string var paths []string
if !PathExists(path) { if !PathExists(path) {
return paths return paths
} }
//path末尾检查/
if path[len(path)-1:] != "/" { if path[len(path)-1:] != "/" {
path += "/" path += "/"
} }
@ -71,7 +70,6 @@ func GetRecentLogs(path string, n int) []string {
d, _ := time.ParseDuration("-24h") d, _ := time.ParseDuration("-24h")
//不到n个返回所有 //不到n个返回所有
nt := Min(n, len(GetPathFiles(path))) nt := Min(n, len(GetPathFiles(path)))
//fmt.Println(nt)
for i := 1; i <= nt; { for i := 1; i <= nt; {
if PathExists(path + data.Format("2006-01-02") + ".log") { if PathExists(path + data.Format("2006-01-02") + ".log") {
paths = append(paths, data.Format("2006-01-02")+".log") paths = append(paths, data.Format("2006-01-02")+".log")