Update main.go

This commit is contained in:
kouha.shu 2019-10-23 10:40:34 +09:00
parent d926a05bec
commit 2ee239a4c0
1 changed files with 1 additions and 1 deletions

View File

@ -433,7 +433,7 @@ func (s *DB) FirstOrCreate(out interface{}, where ...interface{}) *DB {
return c return c
} }
// Update update attributes with callbacks. refer: https://jinzhu.github.io/gorm/crud.html#update // Update update attributes with callbacks, refer: https://jinzhu.github.io/gorm/crud.html#update
// WARNING when update with struct, GORM will not update fields that with zero value // WARNING when update with struct, GORM will not update fields that with zero value
func (s *DB) Update(attrs ...interface{}) *DB { func (s *DB) Update(attrs ...interface{}) *DB {
return s.Updates(toSearchableMap(attrs...), true) return s.Updates(toSearchableMap(attrs...), true)