sanitize: Move global variables to top of file

This commit is contained in:
UlisseMini authored and Andrey Petrov committed 2019-02-24 09:40:47 -06:00
1 parent 4c968fc966
commit c1a8912297
1 file changed
+4 -3
+4 -3
View File
@@ -2,7 +2,10 @@ package sanitize
import "regexp"
var reStripName = regexp.MustCompile("[^\\w.-]")
var (
reStripName = regexp.MustCompile("[^\\w.-]")
reStripData = regexp.MustCompile("[^[:ascii:]]|[[:cntrl:]]")
)
const maxLength = 16
@@ -17,8 +20,6 @@ func Name(s string) string {
return s
}
var reStripData = regexp.MustCompile("[^[:ascii:]]|[[:cntrl:]]")
// Data returns a string with only allowed characters for client-provided metadata inputs.
func Data(s string, maxlen int) string {
if len(s) > maxlen {