package utils import "fmt" type Debug func(format string, v ...interface{}) var hookPrint = func(input string) { fmt.Println(input) } func Init(flag string, enable bool) Debug { return func(format string, v ...interface{}) { if enable { hookPrint(fmt.Sprintf(format, v...)) } } }