diff --git a/logger.go b/logger.go index e3f5fe44..3decaf56 100644 --- a/logger.go +++ b/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)} -} diff --git a/model.go b/model.go index 0b54b2bb..2d3cec47 100644 --- a/model.go +++ b/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{} diff --git a/utils.go b/utils.go index f72dfe16..2233c686 100644 --- a/utils.go +++ b/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 != "" {