Skip to content

key: keep empty shadows when PreserveEmptyShadows is set - #399

Merged
unknwon merged 2 commits into
go-ini:v1from
team-humaki:preserve-empty-shadows
Nov 11, 2026
Merged

unknwon merged 2 commits into
go-ini:v1from
team-humaki:preserve-empty-shadows

Conversation

@team-humaki

Copy link
Copy Markdown

ValueWithShadows currently omits empty assignments. That drops systemd-style resets (Environment= clears prior values).

Add opt-in LoadOptions.PreserveEmptyShadows so callers can keep empty shadow values without changing the default.

Fixes #366

team-humaki and others added 2 commits September 17, 2026 02:09
ValueWithShadows dropped empty assignments, which breaks systemd-style
resets. Opt in with LoadOptions.PreserveEmptyShadows.

Fixes go-ini#366
…ShadowValues

An empty value kept by the option is a reset, so it isn't deduplicated.
The name matches AllowDuplicateShadowValues and the v2 option.
@unknwon
unknwon merged commit 395bef3 into go-ini:v1 Nov 11, 2026
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.

Add option to preserve empty values in ValueWithShadows

2 participants