Add `truncate` function for Go templates Upstream-commit: 818ef473944e8dbb39b7971b96ffdd6035d840ef Component: engine