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

View File

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