Skip to content

Migrate off the archived gopkg.in/yaml.v3 - #349

Merged
masutaka merged 1 commit into
mainfrom
switch-to-go-yaml-in
Aug 13, 2026
Merged

masutaka merged 1 commit into
mainfrom
switch-to-go-yaml-in

Conversation

@masutaka

Copy link
Copy Markdown
Owner

Closes #299

gopkg.in/yaml.v3 (go-yaml/yaml) was archived in April 2025. Move to go.yaml.in/yaml, the successor maintained by the official YAML organization.

Changes

  • Swap the import in lib/settings.go from gopkg.in/yaml.v3 to go.yaml.in/yaml/v3
    • The package name stays yaml, so the yaml.Unmarshal call is untouched
  • go get go.yaml.in/yaml/v3@v3.0.5 && go mod tidy
    • Drops the github.com/kr/pretty and gopkg.in/check.v1 indirect requirements, which came from gopkg.in/yaml.v3's test dependencies

Why v3 and not v4

The upstream README recommends v4 for new projects and upgrades, but v4.0.0-rc.6 (2026-06-17) is still the latest — no GA about a year after rc.1. v3 is GA and still shipping (v3.0.5, 2026-07-26), and the migration is a pure import-path swap.

This matches spf13/cobra#2336, which is referenced in #299.

The tradeoff is that upstream treats v1–v3 as frozen legacy receiving security fixes only, so a second migration to v4 will be needed once it reaches GA.

Verification

  • make test-all passes (vet, golint, tests)
  • YAML parsing is exercised by TestFormatAll in lib/format_test.go, which calls settings.Init("", "") to unmarshal the embedded config/settings.yml and asserts output built from format.line and dictionary.status.*
    • Note that TestInit in lib/settings_test.go is t.Skipped, so it does not cover this
  • make && ./github-nippou list produces the expected output against the real API

config/settings.yml contains only strings, so the YAML 1.1/1.2 differences documented upstream (bools, octals) do not apply here.

- gopkg.in/yaml.v3 was archived in April 2025; yaml/go-yaml under the
  official YAML org is its successor
- The successor recommends v4, but v4.0.0-rc.6 is not GA yet, so pick
  the GA'd, drop-in v3 instead
- Ran `go get go.yaml.in/yaml/v3@v3.0.5 && go mod tidy`
@masutaka
masutaka merged commit 88a99f3 into main Aug 13, 2026
10 checks passed
@masutaka
masutaka deleted the switch-to-go-yaml-in branch August 13, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to the alternative library at gopkg.in/yaml.v3

1 participant