diff --git a/common.go b/common.go index 35987ba..94122fe 100644 --- a/common.go +++ b/common.go @@ -97,7 +97,7 @@ func isInStringLiteral(sql, match string) bool { func ToString(value interface{}) string { switch v := value.(type) { case string: - return v + return value.(string) case []byte: return string(v) case int, int8, int16, int32, int64: @@ -109,7 +109,12 @@ func ToString(value interface{}) string { case bool: return strconv.FormatBool(v) case time.Time: - return v.Format("2006-01-02 15:04:05") + //return v.Format("2006-01-02 15:04:05") + return value.(time.Time).Format("2006-01-02 15:04:05") + case interface{}: + return value.(string) + case nil: + return "" default: return fmt.Sprintf("%v", v) }