2019-02-15T22:37:53Z||2019-02-15T22:37:53Z
出现using unaddressable value
很大几率是一个函数参数是指针,但是你传了个非指针进去,比如gorm的db.Create
:
post := Post{Title: "1"}
db.Create(post)
改成
post := Post{Title: "1"}
db.Create(&post)
就ok了
2019-02-15T22:37:53Z||2019-02-15T22:37:53Z
出现using unaddressable value
很大几率是一个函数参数是指针,但是你传了个非指针进去,比如gorm的db.Create
:
post := Post{Title: "1"}
db.Create(post)
改成
post := Post{Title: "1"}
db.Create(&post)
就ok了