From 01186a2086d91f8a9dbd3bab9d72462ce2bec926 Mon Sep 17 00:00:00 2001 From: djx30103 Date: Mon, 15 Jul 2024 16:45:32 +0800 Subject: [PATCH] docs(README): fix example code using incorrect Save method --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cffce3..6864dd6 100644 --- a/README.md +++ b/README.md @@ -34,5 +34,5 @@ DB.Model(&User{}).Where("id = 1").Update("age", 12) // When want to use GORM's Save method, need to call Select. Otherwise, will return primary key duplicate error. // The Select param is the fields that you want to update or "*". -DB.Model(&user).Select("*").Updates(&User{Age: 18}) +DB.Model(&user).Select("*").Save(&User{Age: 18}) ```