Remove unnecessary init method

This commit is contained in:
Jinzhu 2013-11-19 08:50:07 +08:00
parent 87f493d080
commit 29bc814934
3 changed files with 6 additions and 19 deletions

View File

@ -16,6 +16,9 @@ type defaultLogger struct {
*log.Logger *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{}) { func (logger defaultLogger) Print(v ...interface{}) {
if len(v) > 1 { if len(v) > 1 {
level := v[0] 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)}
}

View File

@ -8,11 +8,7 @@ import (
"time" "time"
) )
var modelFieldMap map[string][]reflect.StructField var modelFieldMap = map[string][]reflect.StructField{}
func init() {
modelFieldMap = map[string][]reflect.StructField{}
}
type Model struct { type Model struct {
data interface{} data interface{}

View File

@ -9,13 +9,8 @@ import (
"time" "time"
) )
var toSnakeMap map[string]string var toSnakeMap = map[string]string{}
var toUpperMap map[string]string var toUpperMap = map[string]string{}
func init() {
toSnakeMap = map[string]string{}
toUpperMap = map[string]string{}
}
func toSnake(u string) string { func toSnake(u string) string {
if v := toSnakeMap[u]; v != "" { if v := toSnakeMap[u]; v != "" {