Replace sync.Once with sync.OnceFunc/OnceValue/OnceValues#4958
Replace sync.Once with sync.OnceFunc/OnceValue/OnceValues#4958
Conversation
Migrate all sync.Once usage to the typed helpers added in Go 1.21. Add a forbidigo lint rule to prevent sync.Once from being reintroduced. Co-authored-by: Isaac
Co-authored-by: Isaac
Approval status: pending
|
|
What is the "why" behind this change? The lint rule is obvious to avoid it in the future but why do we want to avoid it? |
|
All Found these (and others) when going over the release notes of the past couple of Go releases. |
Summary
sync.Onceusage tosync.OnceFunc,sync.OnceValue, orsync.OnceValuesforbidigolint rule to preventsync.Oncefrom being reintroducedbundle/direct/dresourcesThis pull request was AI-assisted by Isaac.