On Thu, Nov 21, 2024 at 1:14 PM 'Hartmut Wieselburger' via golang-nuts
wrote:
>
> Hi,
> is there a way to reset sync.OnceValue(s), as you can do it with sync.Once?
How can you reset a sync.Once?
> A common use case is loading a config. I would like to switch from sync.Once
> to sync.OnceValue,
Hi!
I am trying to more easily add text into my go html templates, that I
can translate at a later stage.
So I tried adding the following in my handler
```go
p := i18nPrinter(c) // *message.Printer, uses golang's i18n library
c.HTML(http.StatusOK, "my-template.tmpl", gin.H{
"p": p,
})
Hi,
is there a way to reset sync.OnceValue(s), as you can do it with sync.Once?
A common use case is loading a config. I would like to switch from
sync.Once to sync.OnceValue, but I need to a chance to reload my config,
without restarting my service.
If this is possible with sync.OnceValue, plea