If you want to avoid the ErrRecordNotFound error, you could use Find like db.Limit(1).Find(&user) , the Find method accepts both struct and slice data.
確定! 回上一頁