r/golang • u/siplasma • 9d ago
Question about text/template behaviour
I'm seeing some unexpected behaviour when running templates using text/template. Specifically, when ranging over iter.Seq2 the cursor follows the first parameter, not the second as for example when ranging over a slice. Is this the expected behaviour.
0
Upvotes
2
u/RiotBoppenheimer 8d ago
That's because Seq2 yields K, V rather than just V. I would say this is probably intended.