# v1.2.1 Release Notes

> 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.

<details>
<summary>翻譯</summary>

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

</details>

## ⚠️ Breaking Changes

### Import path and package name changed

**Before:**

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

**After:**

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

**Migration:**

```go
// 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})
```

<details>
<summary>翻譯</summary>

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

</details>

### `List()` return type changed

**Before:**

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

**After:**

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

**Migration:**

```go
// 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)
}
```

<details>
<summary>翻譯</summary>

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

</details>

## 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]

<details>
<summary>翻譯</summary>

- 將排程器套件移至 `core/`，套件名改為 `core`
- `List()` 改為回傳 `[]*task`，不再回傳複製的 `[]task`

</details>

### REFACTOR

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

<details>
<summary>翻譯</summary>

- 將任務最小堆 `Push` 與 `Pop` 的 `interface{}` 改為 `any`

</details>

### DOC

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

<details>
<summary>翻譯</summary>

- 於 `doc/` 重建雙語 README、技術文件與架構圖，並移除根目錄 `README.zh.md`

</details>

### TEST

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

<details>
<summary>翻譯</summary>

- 調整 `List` 測試以配合指標元素

</details>

### CHORE

- Run the test workflow on `develop` pushes and pull requests instead of version tags (@pardnchiu)  [3189a6c]
- Ignore the `wiki-worker/` directory (@pardnchiu)  [0768463]

<details>
<summary>翻譯</summary>

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

</details>

## 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](https://github.com/pardnchiu/skill-version-generate)
