mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-10 22:02:09 +08:00
【升级go 1.18】
This commit is contained in:
@@ -18,7 +18,7 @@ func InitJob() {
|
||||
type CronHandle struct {
|
||||
}
|
||||
|
||||
func (t CronHandle) Exec(arg interface{}) error {
|
||||
func (t CronHandle) Exec(arg any) error {
|
||||
str := time.Now().Format(timeFormat) + " [INFO] JobCore ExamplesOne exec success"
|
||||
// TODO: 这里需要注意 Examples 传入参数是 string 所以 arg.(string);请根据对应的类型进行转化;
|
||||
switch arg.(type) {
|
||||
|
||||
@@ -8,9 +8,9 @@ type Job interface {
|
||||
}
|
||||
|
||||
type JobsExec interface {
|
||||
Exec(arg interface{}) error
|
||||
Exec(arg any) error
|
||||
}
|
||||
|
||||
func CallExec(e JobsExec, arg interface{}) error {
|
||||
func CallExec(e JobsExec, arg any) error {
|
||||
return e.Exec(arg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user