Skip to content

[Question] Code example error in pages/zh_CN/gen/create.md Upsert / On Conflict #803

@Kira3270

Description

@Kira3270

I noticed an error in the code example under the "Upsert / On Conflict" section of the documentation.
The line of code ”err := query.User.WithContext(ctx).Clauses(clause.OnConflict{DoUpdates: clause.AssignmentColumns([]string{"name", "age"}),}).Create(&user).Error“ is incorrect; the Error() method should not be called here because Create already returns an error pointer.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions