package util import ( "errors" "fmt" ) func NewError(format string, a ...interface{}) error { if a == nil || len(a) == 0 { return errors.New(format) } return errors.New(fmt.Sprintf(format, a...)) }