I
I
impressive172020-04-14 22:06:27
go
impressive17, 2020-04-14 22:06:27

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

1 answer(s)
D
Dimonchik, 2020-04-14
@dimonchik2013

pass non-empty

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question