text/template: missingkey does not affect builtin "index" function #60008
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The documentation for the
missingkey
option says:It sounds like it might apply to
index
builtin function as well, but it applies only to the.X.Y.Z
syntax.https://go.dev/play/p/ZneXhxfIBWT
It's hard to say whether this is behavioural bug, or just an ambiguity in documentation. Although I have use cases where
missingkey
applying toindex
builtin would be preferrable (replacement for.X.Y.Z
if map keys don't happen to be valid identifiers), this indeed would be inconsistent with index expression of Go language itself.The text was updated successfully, but these errors were encountered: