Remove useless comments
This commit is contained in:
parent
cc0440055a
commit
b9171867f6
@ -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
|
||||||
|
|||||||
@ -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")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user