func (cr *MyAPIController) Read(id string, cx *goweb.Context) { if id == "1" { cx.RespondWithData(TestEntity{id, "Mat", 28}) } else if id == "2" { cx.RespondWithData(TestEntity{id, "Laurie", 27}) } else { cx.RespondWithNotFound() } }