mirror of https://github.com/go-gorm/gorm.git
Remove unnecessary init method
This commit is contained in:
parent
87f493d080
commit
29bc814934
10
logger.go
10
logger.go
|
@ -16,6 +16,9 @@ type defaultLogger struct {
|
|||
*log.Logger
|
||||
}
|
||||
|
||||
//var default_logger = log.New(os.Stdout, "\r\n", 0)
|
||||
var default_logger = defaultLogger{log.New(os.Stdout, "\r\n", 0)}
|
||||
|
||||
func (logger defaultLogger) Print(v ...interface{}) {
|
||||
if len(v) > 1 {
|
||||
level := v[0]
|
||||
|
@ -34,10 +37,3 @@ func (logger defaultLogger) Print(v ...interface{}) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
var default_logger defaultLogger
|
||||
|
||||
func init() {
|
||||
// default_logger = log.New(os.Stdout, "\r\n", 0)
|
||||
default_logger = defaultLogger{log.New(os.Stdout, "\r\n", 0)}
|
||||
}
|
||||
|
|
6
model.go
6
model.go
|
@ -8,11 +8,7 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var modelFieldMap map[string][]reflect.StructField
|
||||
|
||||
func init() {
|
||||
modelFieldMap = map[string][]reflect.StructField{}
|
||||
}
|
||||
var modelFieldMap = map[string][]reflect.StructField{}
|
||||
|
||||
type Model struct {
|
||||
data interface{}
|
||||
|
|
9
utils.go
9
utils.go
|
@ -9,13 +9,8 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var toSnakeMap map[string]string
|
||||
var toUpperMap map[string]string
|
||||
|
||||
func init() {
|
||||
toSnakeMap = map[string]string{}
|
||||
toUpperMap = map[string]string{}
|
||||
}
|
||||
var toSnakeMap = map[string]string{}
|
||||
var toUpperMap = map[string]string{}
|
||||
|
||||
func toSnake(u string) string {
|
||||
if v := toSnakeMap[u]; v != "" {
|
||||
|
|
Loading…
Reference in New Issue