However, to answer your question about subtraction: You’re correct that you cannot use infix operators like +, -, etc. in Go templates. That’s why the check for less than is lt left right. You could write your own sub function like this:
func sub(a, b int) int { return a - b}
// and then wherever you're initializing your template, register your sub function like this:
tmpl := template.New("")/* ... */.Funcs(template.FuncMap{"sub": sub})/* ... */.Execute(...)