I have some code on the server:
...
c.HTML(http.StatusOK, "videos.html", gin.H{
"files": files, //slice
"errMessage": errMessage,
})
...
And I have some code on the client:
...
{{ range .files }}
<tr>
<td>{{.}}</td>
<td><a href="/download?filename={{.}}" style="color:blue;">Download</a></td>
<td><a href="/delete?filename={{.}}" style="color:red;">Delete</a></td>
<td><button id="{{.}}">Посмотреть</button></td>
{{ if .errMessage }} <td style="color:red;">Processing...</td>
{{ else }} <td>Done</td> {{ end }}
</tr>
{{ end }}
...
How to deal with .errMessage?