Answer the question
In order to leave comments, you need to log in
How to check array length in Golang html templates?
How to check array length in Golang html templates?
Answer the question
In order to leave comments, you need to log in
This is how you can
{{ $length := len .YourArray }}
{{ if eq $length 0 }}
array has zero length
{{ end }}
{{ len .YourArray }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question