June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package templates import ( "os" "strings" "text/template" ) const sampleTemplate = ` This template demonstrates printing a {{ .Variable | printf "%#v" }}. {{if .Condition}} If condition is set, we'll print this {{else}} Otherwise, we'll print this instead {{end}} Next we'll iterate over an array of strings: {{range $index, $item := .Items}} {{$index}}: ...