Sorry im beginner and i read golang.docs but didnt understand well. i`ve : index.html:
<html>
<head>
</head>
<body>
<form action type="checkbox" name="test" value="A" {{.checked}}>
<input type="submit" value="save">
</body>
</html>
in main.go if user click save button then check checkbox redirect that page and show checkbox checked
You could send variables in map. For example:
The
.
is defined in go code.Please provide the snippet of your go code where the template is executed, something like the following codes:
Or
You can pass any type(interface{}) to a functions that execute a template as "data". Usually it is a Struct or a Map[string]string.
How to set the checked Probably the "checked" is setted in the main.go at handler according to the posted form.
Read the docs and explain it better. Please