Skip to content

Conversation

@mtlynch
Copy link
Owner

@mtlynch mtlynch commented Jan 23, 2026

Replace manual sync.Once pattern with sync.OnceValue from Go 1.21. This simplifies the allowed password characters initialization by removing the need for a custom struct type and explicit Do() call.

sync.OnceValue returns a function that lazily initializes and caches the value on first call, making the code more concise and idiomatic.

mtlynch and others added 2 commits January 23, 2026 00:34
Replace manual sync.Once pattern with sync.OnceValue from Go 1.21.
This simplifies the allowed password characters initialization by
removing the need for a custom struct type and explicit Do() call.

sync.OnceValue returns a function that lazily initializes and caches
the value on first call, making the code more concise and idiomatic.

Co-authored-by: Shelley <shelley@exe.dev>
@mtlynch mtlynch enabled auto-merge (squash) January 23, 2026 00:57
@mtlynch mtlynch merged commit 8870545 into master Jan 23, 2026
9 checks passed
@mtlynch mtlynch deleted the modernize/sync-once-value branch January 23, 2026 01:00
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants