github.com/aarzilli/tools@v0.0.0-20151123112009-0d27094f75e0/net/http/domclean2/funcs_spacey.go (about) 1 package domclean2 2 3 import ( 4 "regexp" 5 "strings" 6 ) 7 8 var replNewLines = strings.NewReplacer("\r\n", " ", "\r", " ", "\n", " ") 9 var replTabs = strings.NewReplacer("\t", " ") 10 var doubleSpaces = regexp.MustCompile("([ ]+)") 11 12 // isSpacey detects all possible occurrences of whitespace 13 func isSpacey(sarg string) bool { 14 s := strings.TrimSpace(sarg) // TrimSpace removes leading-trailing \n \r\n 15 if s == "" { 16 return true 17 } 18 return false 19 }