make lint happy

This commit is contained in:
fumiama
2021-12-25 13:01:05 +08:00
parent 59fe8a021f
commit eebfa23509
11 changed files with 90 additions and 77 deletions

View File

@@ -21,7 +21,7 @@ func (ts *Timer) GetTimerInfo() string {
return fmt.Sprintf("[%d]%d月%d日%d周%d:%d", ts.GrpId, ts.Month(), ts.Day(), ts.Week(), ts.Hour(), ts.Minute())
}
// GetTimerInfo 获得标准化 ID
// GetTimerID 获得标准化 ID
func (ts *Timer) GetTimerID() uint32 {
key := ts.GetTimerInfo()
m := md5.Sum(helper.StringToBytes(key))
@@ -155,13 +155,12 @@ func chineseNum2Int(rs []rune) int {
func chineseChar2Int(c rune) int {
if c == rune('日') || c == rune('天') { // 周日/周天
return 7
} else {
match := []rune("零一二三四五六七八九十")
for i, m := range match {
if c == m {
return i
}
}
return 0
}
match := []rune("零一二三四五六七八九十")
for i, m := range match {
if c == m {
return i
}
}
return 0
}

View File

@@ -1,11 +1,10 @@
package timer
import (
"strconv"
"github.com/FloatTech/ZeroBot-Plugin/utils/sql"
)
// Timer 计时器
type Timer struct {
Id uint32 `db:"id"`
En1Month4Day5Week3Hour5Min6 int32 `db:"emdwhm"`
@@ -20,7 +19,9 @@ func (t *Timer) InsertInto(db *sql.Sqlite) error {
return db.Insert("timer", t)
}
/*
func getTimerFrom(db *sql.Sqlite, id uint32) (t Timer, err error) {
err = db.Find("timer", &t, "where id = "+strconv.Itoa(int(id)))
return
}
*/