Answer the question
In order to leave comments, you need to log in
How to check in a slice in an html template that an element is equal to something in GOLANG?
Let's say I pass a string slice S to the HTML template, how do I output only non-empty strings?
For example,
{{range .S}}
{{if ????}}
Вывести {{ .}}
{{end}}
{{end}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question