一只斗牛犬
https://gorm.io/docs/update.html#Update-single-column您可以将列更新为 ,例如deleted_atNULLdb.Model(&User{}).Where("id", 1).Update("deleted_at", nil)例:type User struct { gorm.Model gorm.DeletedAt Name string}db.AutoMigrate(&User{})db.Create(&User{Name: "John Doe"})u := new(User)fmt.Println(db.First(u, 1).Error) // nildb.Delete(u, 1)fmt.Println(db.First(u, 1).Error) // record not founddb.Model(u).Update("deleted_at", nil)fmt.Println(db.First(u, 1).Error) // nil