how to run range for one time in go template
{{range . }}
<a href="/detailed/{{.Namespace}}">
<p style="text-align: center;font-size: 2rem;">{{.Namespace}}</p>
{{end}}
I need only first value of Namespace bY using this i am getting more than one values in html
You can use this way
<a href="/detailed/{{ (index . 0).Namespace }}"><p style="text-align: center;font-size: 2rem;">{{ (index . 0).Namespace }}</p>
Basically, what you want is to get the first element from the range which if you search hard it enough, you can find the answer in another post.