v1.2.1

v1.2.1 Release Notes

Released

v1.2.0 -> v1.2.1

Summary

Relocates the scheduler into a dedicated subpackage and tightens the task listing to return live references instead of copies. Public documentation is rebuilt as a bilingual set aligned with actual runtime behavior.

翻譯

將排程器移入獨立子套件,並讓任務列表改為回傳實際參照而非複本。公開文件重建為對齊實際執行行為的雙語文件集。

⚠️ Breaking Changes

Import path and package name changed

Before:

import cron "github.com/pardnchiu/go-scheduler" // package goCron

After:

import "github.com/pardnchiu/go-scheduler/core" // package core

Migration:

// Old
import cron "github.com/pardnchiu/go-scheduler"

scheduler, err := cron.New(cron.Config{Location: time.Local})

// New
import "github.com/pardnchiu/go-scheduler/core"

scheduler, err := core.New(core.Config{Location: time.Local})
翻譯

套件自模組根目錄移至 core/ 子目錄,匯入路徑改為 github.com/pardnchiu/go-scheduler/core,套件名由 goCron 改為 core;所有 New、Config、Wait、Stop、Skip 等引用需改用新匯入路徑。

List() return type changed

Before:

func (c *cron) List() []task

After:

func (c *cron) List() []*task

Migration:

// Old
tasks := scheduler.List()
for i := range tasks {
    t := &tasks[i]
    fmt.Println(t.ID)
}

// New
for _, t := range scheduler.List() {
    fmt.Println(t.ID)
}
翻譯

List() 由回傳任務複本 []task 改為回傳指標 []*task;原本以 &tasks[i] 取址的寫法需改為直接使用元素。回傳值指向排程器內部任務,不再是快照。

Changes

BREAKING

翻譯
  • 將排程器套件移至 core/,套件名改為 core
  • List() 改為回傳 []*task,不再回傳複製的 []task

REFACTOR

翻譯
  • 將任務最小堆 Push 與 Pop 的 interface{} 改為 any

DOC

翻譯
  • 於 doc/ 重建雙語 README、技術文件與架構圖,並移除根目錄 README.zh.md

TEST

翻譯
  • 調整 List 測試以配合指標元素

CHORE

翻譯
  • 測試 workflow 改於 develop 的 push 與 pull request 觸發,不再以版本 tag 觸發
  • 忽略 wiki-worker/ 目錄

Scope


Generated by SKILL