Home / Go / html templating edit
Try Documentalist, my app that offers fast, offline access to 190+ programmer API docs.

## if
if returns false for false booleans, empty strings, empty slices

{{ if .Foo }} ... {{ end }}

{{ if not .Foo }} ... {{ end }}

## Slices: iterate, get length

{{ range .Slice }} ... {{ end }}

{{ len .Slice }}

## Variables

{{ $isAdmin := .IsAdmin }}

{{ if $isAdmin }} ... {{ end }}

## Include another template

{{ template "foo.html" }}

This includes a template named "foo".

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:

Share on        

Need fast, offline access to 190+ programmer API docs? Try my app Documentalist for Windows