Access out of loop value inside golang template’s loop

You should know that the variable passed in to the template is available as $.

{{range .Pages}}
    <li><a href="https://stackoverflow.com/questions/16734503/{{$.Name}}/{{.}}">{{.}}</a></li>
{{end}}

(See the text/template documentation under “Variables”.)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)