It’s unclear to me what “ignore” means.
I’m looking for a way to disable caching during builds so warnf will print a line every time.
It’s unclear to me what “ignore” means.
I’m looking for a way to disable caching during builds so warnf will print a line every time.
warnf
does not emit duplicate warnings.
{{ range seq 1 10 }}
{{ warnf "%v" "foo" }}
{{ end }}
WARN 2023/02/19 16:55:10 foo
{{ range seq 1 3 }}
{{ warnf "%v" . }}
{{ end }}
WARN 2023/02/19 16:55:59 1
WARN 2023/02/19 16:55:59 2
WARN 2023/02/19 16:55:59 3
Is there a way to ensure a unique output, aside from incorporating now
values in the output, which may or may not be unique between calls? I don’t see uuid or random functions. In my case, I need to print values in a partial, so I can’t use seq or range to do it.
Use now.UnixMilli
.
Use
now.UnixMilli
It might return duplicate values, but multiple runs could probably avoid that issue.
I guess there’s seq 1 1000 | shuffle | first
too. Not great, not terrible.
Then move to now.UnixNano
.
Same issue, if I remember correctly. Less likely, but still possible to get the same value. As I said, you can always run it again if the time values aren’t unique in one particular build.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.