Top "Go-templates" questions

Go language supports built-in template functionality.

Iterating through map in template

I am trying to display a list gym classes (Yoga, Pilates etc). For each class type there are several classes, …

go go-templates
Switch or if/elseif/else inside golang HTML templates

I have this struct : const ( paragraph_hypothesis = 1<<iota paragraph_attachment = 1<<iota paragraph_menu = 1<<iota ) …

html templates go go-templates
Access a map value using a variable key in a Go template

How can I look up the value of a map by using a variable key without iterating? So one can …

go templates go-templates
Variables inside templates in golang

What is the namespace of variables inside html/text templates? I thought that a variable $x can change value inside …

templates variables go go-templates
If not true (!true)

In golang's template/html package, I can use {{ if .loggedIn }} to check if logged in is true. How do I …

if-statement go go-templates
Kubernetes Helm, combine two variables with a string in the middle

I’m trying to change the value of a variable if another variable it set by combining the two with …

kubernetes go-templates kubernetes-helm
Kubernetes Helm Chart If Condition Check

I am trying to add if great than condition in Helm chart. it is throwing error. I have defined value …

go kubernetes go-templates kubernetes-helm
How to range over slice of structs instead of struct of slices

Having played around with Go HTML templates a bit, all the examples I found for looping over objects in templates …

html templates go struct go-templates
Compare strings in templates

I have the following template: {{if . eq "login failed"}} <span class="text-error">Incorrect username or password</span&…

go-templates
Go template.ExecuteTemplate include html

I have followed this tutorial: http://golang.org/doc/articles/wiki/final.go and have slightly modified it for my …

go go-templates