GORM create record that might already exist
问题 I'm using gorm with postgres in my Go app. I want to create a new user in the database, but there is a good chance that that user will already exist. If so, I want to not do anything with the database, but I want know about it so I can tell the user. The good news is, that's already what gorm.Create(..) does. Trying to create a record with a duplicate unique key will return an error. There are two problems: I want better error messages. I want to write custom user-facing error messages that