You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use sync.OnceValue for various regular expressions, require go1.21
Using regex.MustCompile consumes a significant amount of memory when
importing the package, even if those regular expressions are not used.
This changes compiling the regular expressions to use a sync.OnceValue
so that they're only compiled the first time they're used.
There are various regular expressions remaining that are still compiled
on import, but these are exported, so changing them to a sync.OnceValue
would be a breaking change; we can still decide to do so, but leaving
that for a follow-up.
It's worth noting that sync.OnceValue requires go1.21 or up, so raising
the minimum version accordingly.
Signed-off-by: Sebastiaan van Stijn <[email protected]>
0 commit comments