Give (*ModelStruct).TableName() a pointer receiver

There was a data race caused by the copy of the ModelStruct. See #723.

Fixes #723.
This commit is contained in:
Peter Waller 2015-12-23 10:42:03 +00:00
parent d209be3138
commit 5ba59aec5f
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ type ModelStruct struct {
cached bool cached bool
} }
func (s ModelStruct) TableName(db *DB) string { func (s *ModelStruct) TableName(db *DB) string {
return DefaultTableNameHandler(db, s.defaultTableName) return DefaultTableNameHandler(db, s.defaultTableName)
} }