I have below code. I am trying to convert from string value to time format and assigning the value and failing with below error at line no:
cannot assign time.Time to psdvalue (type string) in multiple assignment
Code:
type Tracking struct {
release_name string
planned_start_date time.Time
}
const layout = "01-02-2006"
func saveHandler(response http.ResponseWriter, request *http.Request) {
releasevalue := request.FormValue("ReleaseName")
psdvalue := request.FormValue("PSD")
if len(strings.TrimSpace(psdvalue)) > 0 {
//line no: psdvalue, _ = time.Parse(layout, psdvalue)
}
array = append(array, Tracking{
release_name: releasevalue,
planned_start_date: psdvalue,
})
}