Top "Go-templates" questions

Go language supports built-in template functionality.

Helm optional nested variables

How do I make an optional block in the values file and then refer to it in the template? For …

kubernetes kubernetes-helm go-templates
Error "property value expected css" and "at-rule or selector expected css" editing Go template in VSCode

I'm using Go and package html/template. This is my code in mypage.tmpl: <div class="col-sm-1"> <…

go visual-studio-code go-templates
Define a variable in Helm template

I need to define a variable based on an if statement and use that variable multiple times. In order not …

kubernetes-helm go-templates
Size list with helm

Simple question is it possible to get size list with helm and sprig function ? My list : list: - a - …

go kubernetes-helm go-templates sprig-template-functions
Go template function

It noticed a weird thing with Go templates when I try to use Funcs and FuncMap. The following code works …

go go-templates
Golang templates (and passing funcs to template)

I'm getting an error when I try and access a function I'm passing to my template: Error: template: struct.tpl:3: …

templates go go-templates
How to pass multiple data to Go template?

I want to pass two data objects to Go Template. One is a MongoDB query result and other is an …

go go-templates
How to pass just a variable (not a struct member) into text/html template. Golang

is there any way to pass just a variable (string, int, bool) into template. For example (something similar): import ( "html/…

go templates go-templates
Golang embed html from file

How can I do in Golang if I have an HTML file like this: <html> <head lang="…

templates go go-templates
Global template data

When doing ExecuteTemplate I see all examples using &whateversruct{Title: "title info", Body: "body info"} to send data to …

go go-templates