2014-02-07 08:58:27 +02:00
|
|
|
package sqlmock
|
|
|
|
|
|
2014-02-07 15:04:47 +02:00
|
|
|
import (
|
|
|
|
|
"regexp"
|
|
|
|
|
"strings"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var re *regexp.Regexp
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
re = regexp.MustCompile("\\s+")
|
|
|
|
|
}
|
2014-02-07 08:58:27 +02:00
|
|
|
|
|
|
|
|
// strip out new lines and trim spaces
|
|
|
|
|
func stripQuery(q string) (s string) {
|
2014-02-07 15:04:47 +02:00
|
|
|
return strings.TrimSpace(re.ReplaceAllString(q, " "))
|
2014-02-07 08:58:27 +02:00
|
|
|
}
|