func GetTechSupportByContact(rw http.ResponseWriter, req *http.Request, enc encoding.Encoder, params martini.Params, dtx *apicontext.DataContext) string { var err error var t techSupport.TechSupport id := params["id"] t.Contact.ID, err = strconv.Atoi(id) if err != nil { apierror.GenerateError("Error parsing contact Id.", err, rw, req) } ts, err := t.GetByContact(dtx) if err != nil { apierror.GenerateError("Error getting Tech Support by Contact Id.", err, rw, req) } return encoding.Must(enc.Encode(ts)) }