Skip to content

Commit

Permalink
Remove unnecessary init method
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Nov 19, 2013
1 parent 87f493d commit 29bc814
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
10 changes: 3 additions & 7 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 changes: 1 addition & 5 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
9 changes: 2 additions & 7 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 29bc814

Please sign in to comment.