removed newModelStructsMap func

This commit is contained in:
Artemij Shepelev 2018-08-03 11:57:05 +03:00
parent c94879ea64
commit bd4ed43163
2 changed files with 3 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"reflect" "reflect"
"strings" "strings"
"sync"
"time" "time"
) )
@ -162,7 +163,7 @@ func (s *DB) HasBlockGlobalUpdate() bool {
// SingularTable use singular table by default // SingularTable use singular table by default
func (s *DB) SingularTable(enable bool) { func (s *DB) SingularTable(enable bool) {
modelStructsMap = newModelStructsMap() modelStructsMap = sync.Map{}
s.parent.singularTable = enable s.parent.singularTable = enable
} }

View File

@ -17,9 +17,7 @@ var DefaultTableNameHandler = func(db *DB, defaultTableName string) string {
return defaultTableName return defaultTableName
} }
func newModelStructsMap() sync.Map { return sync.Map{} } var modelStructsMap sync.Map
var modelStructsMap = newModelStructsMap()
// ModelStruct model definition // ModelStruct model definition
type ModelStruct struct { type ModelStruct struct {