removed newModelStructsMap func
This commit is contained in:
parent
c94879ea64
commit
bd4ed43163
3
main.go
3
main.go
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user