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:
  1. import cron "github.com/pardnchiu/go-scheduler" // package goCron

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

Migration:
  1. // Old
  2. import cron "github.com/pardnchiu/go-scheduler"
  3. scheduler, err := cron.New(cron.Config{Location: time.Local})
  4. // New
  5. import "github.com/pardnchiu/go-scheduler/core"
  6. 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:
  1. func (c *cron) List() []task

After:
  1. func (c *cron) List() []*task

Migration:
  1. // Old
  2. tasks := scheduler.List()
  3. for i := range tasks {
  4. t := &tasks[i]
  5. fmt.Println(t.ID)
  6. }
  7. // New
  8. for _, t := range scheduler.List() {
  9. fmt.Println(t.ID)
  10. }

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

Changes


BREAKING


  • Move the scheduler package to core/ with package name core (@pardnchiu) [3189a6c]
  • Return []*task from List() instead of copied []task values (@pardnchiu) [3189a6c]

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


REFACTOR


  • Replace interface{} with any in task heap Push and Pop (@pardnchiu) [3189a6c]

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


DOC


  • Rebuild bilingual README, technical documentation, and architecture diagrams under doc/, and remove the root README.zh.md (@pardnchiu) [9a33c30, 3189a6c, 0768463]

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


TEST


  • Adapt List test to pointer elements (@pardnchiu) [3189a6c]

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


CHORE


  • Run the test workflow on develop pushes 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/ — DOC
  • README.zh.md — DOC
  • .github/workflows/test.yml — CHORE
  • .gitignore — CHORE



Generated by SKILL