Skip to content

go: migrate to unknwon.dev/ini/v2 v2.0.0-beta.4 - #25

Open
unknwon wants to merge 2 commits into
mainfrom
ini-v2
Open

unknwon wants to merge 2 commits into
mainfrom
ini-v2

Conversation

@unknwon

@unknwon unknwon commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Replaces gopkg.in/ini.v1 v1.67.2 with unknwon.dev/ini/v2 v2.0.0-beta.4.

Only cmd/lfsd/config.go uses the package. The one API change that affects it is File.ValueMapper, which v2 replaces with the ini.ValueMapping load option, so os.ExpandEnv is now passed to ini.Load.

[storage "..."] and [forge "..."] sections are now read with File.Subsections instead of hand-parsing section names. This also accepts the dotted form, such as [forge.github.com], and \" escapes in quoted names. A malformed header such as [storage "local] is now skipped instead of failing with "malformed storage section name".

Test plan

  • go build ./..., go test ./... and golangci-lint run pass.
  • A throwaway test loaded the embedded config plus a custom file and checked that ${VAR} expansion (including a value containing #), custom overrides, %(ROOT)s references, and forge and storage sections map as before.
  • Another throwaway test checked that [forge "GitHub.com"], [forge.gitlab.example.com] and [storage "s3 \"x\""] all load, and that [forge "a.com"] plus [forge.a.com] is reported as a duplicate.

Replace gopkg.in/ini.v1 with unknwon.dev/ini/v2. The value mapper is now
passed as a load option instead of set on the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant