Skip to content

Commit 63a60da

Browse files
authored
Merge pull request #37 from djx30103/master
docs(README): fix example code using incorrect Save method
2 parents 9293bbb + 01186a2 commit 63a60da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ DB.Model(&User{}).Where("id = 1").Update("age", 12)
3434

3535
// When want to use GORM's Save method, need to call Select. Otherwise, will return primary key duplicate error.
3636
// The Select param is the fields that you want to update or "*".
37-
DB.Model(&user).Select("*").Updates(&User{Age: 18})
37+
DB.Model(&user).Select("*").Save(&User{Age: 18})
3838
```

0 commit comments

Comments
 (0)