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
- Move the scheduler package to
core/with package namecore(@pardnchiu) [3189a6c] - Return
[]*taskfromList()instead of copied[]taskvalues (@pardnchiu) [3189a6c]
翻譯
- 將排程器套件移至
core/,套件名改為core List()改為回傳[]*task,不再回傳複製的[]task
REFACTOR
- Replace
interface{}withanyin task heapPushandPop(@pardnchiu) [3189a6c]
翻譯
- 將任務最小堆
Push與Pop的interface{}改為any
DOC
- Rebuild bilingual README, technical documentation, and architecture diagrams under
doc/, and remove the rootREADME.zh.md(@pardnchiu) [9a33c30, 3189a6c, 0768463]
翻譯
- 於
doc/重建雙語 README、技術文件與架構圖,並移除根目錄README.zh.md
TEST
- Adapt
Listtest to pointer elements (@pardnchiu) [3189a6c]
翻譯
- 調整
List測試以配合指標元素
CHORE
- Run the test workflow on
developpushes and pull requests instead of version tags (@pardnchiu) [3189a6c] - Ignore the
wiki-worker/directory (@pardnchiu) [0768463]
翻譯
- 測試 workflow 改於
develop的 push 與 pull request 觸發,不再以版本 tag 觸發 - 忽略
wiki-worker/目錄
Scope
core/— BREAKING, REFACTOR, TEST (moved from repository root)README.md,doc/— DOCREADME.zh.md— DOC.github/workflows/test.yml— CHORE.gitignore— CHORE
Generated by SKILL