On my program I have a Product structure
type Product struct{
SupplierId string
Category1 string
Category2 string
DefaultColor string
SupplierRef string
}
On the form I have
<div class="form-group row">
<label for="category2" class="col-sm-2 col-form-label">Sub Category</label>
<div class="col-sm-4">
<select class="form-control" value="{{ .Category2 }}" name="category2" id="category2">
<option value="Select">Select</option>
<option value="1">Dresses</option>
<option value="2">Skirt</option>
<option value="3">Blouses</option>
<option value="4">Pants</option>
<option value="5">Hand Bags</option>
</select>
</div>
</div>
To move date from data (from source to form) I have the following code
product := Product{}
product.Category2 = "5" //for Hand Bags
Problem : My form does not render with the selected item. (I am new to Go/html)