title: Arithmetic in Go templates
body: <p>I am trying to achieve a very simple thing in a Go template and failing!</p>
  
  <p>The <code>range</code> action allows me to iterate through an array along with its zero-based index, as so:</p>
  
  <pre><code>{{range $index, $element := .Pages}}
    Number: {{$index}}, Text: {{element}}
  {{end}}
  </code></pre>
  
  <p>However, I am trying to output indices that start counting from 1. My first attempt failed:</p>
  
  <pre><code>Number: {{$index + 1}}
  </code></pre>
  
  <p>This throws an <code>illegal number syntax: "+"</code> error.</p>
  
  <p>I looked into the go-lang official documentation and did not find anything particular regarding the arithmetic operation inside the template. </p>
  
  <p>What am I missing?</p>