The documentation of testing.Benchmark says that
If f depends on testing flags, then [Init] must be used to register
those flags before calling Benchmark and before calling [flag.Parse].
but doesn't specify what might depend on the flags.
I ran into this when I returned inside a for b.Loop() loop, which tried to log an error, but instead panicked because logging accesses the fullPath flag.
The documentation of
testing.Benchmarksays thatbut doesn't specify what might depend on the flags.
I ran into this when I returned inside a
for b.Loop()loop, which tried to log an error, but instead panicked because logging accesses thefullPathflag.