Answers for "check if gorm created successfully"

Go
0

check if gorm created successfully

if err := db.Create(&Animal{Name: "Giraffe"}).Error; err != nil {
   // Create failed, do something e.g. return, panic etc.
   return 
}
Posted by: Guest on March-09-2020

Browse Popular Code Answers by Language