Skip to content

Preserve updated values when exporting environment settings - #109

Merged
inhere merged 1 commit into
gookit:masterfrom
bensynapse:fix-stale-environment-overrides
Oct 10, 2026
Merged

inhere merged 1 commit into
gookit:masterfrom
bensynapse:fix-stale-environment-overrides

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

I run Live Tennis API.

Loading value = ${TOKEN|old} and then value = replacement updates Get, but WriteTo exports the old expression. Reloading that output restores old.

Discard cached expressions when values or sections change. Cache entries use both the section name and key, so names such as a_b.c and a.b_c cannot collide. Export uses a copy of the data to preserve untouched expressions without changing current values.

The tests cover each update method and deletion. They also check case handling, rejected writes and colliding names. The original code fails the replacement regressions.

Validation: the full suite and race checks pass. Build and vet pass with Go 1.19.13, which also passes the suite. Staticcheck reports the same 131 existing diagnostics as the baseline. Golint reports its existing EncodeOptions comment warning.

@inhere
inhere merged commit 9b3a12f into gookit:master Oct 10, 2026
9 checks passed
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.

2 participants