go, mysql, sqlx

mysql golang xue8 279天前 305次浏览



type Jobs struct {


Job_id string `json:"job_id" from:"job_id"`
Job_title string `json:"job_title" from:"job_title"`
Min_salary int `json:"min_salary" from:"min_salary"`
Max_salary int `json:"max_salary" from:"max_salary"`

}


func JobList() ([]Jobs, error) {


jobs := make([]Jobs, 0)
err := DB.Get(&jobs, "select * from `jobs`")
return jobs, err

}


sqlYog中能直接查出,但是beego查不出来,一直报错
Handler crashed with error scannable dest type slice with >1 columns (4) in result





回答:
[]

0条回复
撰写答案