Text and HTML templates / range action / Essential

Run Settings
LanguageGo
Language Version
Run Command
package main import ( "log" "os" "text/template" ) const tmplStr = `Elements of a channel: {{ range . }}{{ . }} {{end}} ` func main() { t := template.Must(template.New("range").Parse(tmplStr)) ch := make(chan int) go func() { for i := 0; i < 3; i++ { ch <- i } close(ch) }() err := t.Execute(os.Stdout, ch) if err != nil { log.Fatalf("t.Execute() failed with '%s'\n", err) } }
Editor Settings
Theme
Key bindings
Full width
Lines