优化部分测试用例

This commit is contained in:
Yun
2025-10-06 00:13:42 +08:00
parent 9caa984846
commit bae669a1d9
4 changed files with 371 additions and 17 deletions
+3 -1
View File
@@ -10,6 +10,8 @@ import (
"github.com/yuninks/timerx"
)
var save_path = "./cluster.log"
func main() {
ctx := context.Background()
@@ -252,7 +254,7 @@ func callback(ctx context.Context, extendData any) error {
fmt.Println("任务执行了", extendData, "时间:", time.Now().Format("2006-01-02 15:04:05"))
// 追加到文件
file, err := os.OpenFile("./test.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
file, err := os.OpenFile(save_path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
fmt.Println("打开文件失败:", err)
return err