MCPcopy Index your code
hub / github.com/git-bug/git-bug / Safe

Function Safe

util/text/validate.go:21–34  ·  view source on GitHub ↗

Safe will tell if a character in the string is considered unsafe Currently trigger on unicode control character except \n, \t and \r

(s string)

Source from the content-addressed store, hash-verified

19// Safe will tell if a character in the string is considered unsafe
20// Currently trigger on unicode control character except \n, \t and \r
21func Safe(s string) bool {
22 for _, r := range s {
23 switch r {
24 case '\t', '\r', '\n':
25 continue
26 }
27
28 if unicode.IsControl(r) {
29 return false
30 }
31 }
32
33 return true
34}
35
36// SafeOneLine will tell if a character in the string is considered unsafe
37// Currently trigger on all unicode control character

Callers 4

ValidateMethod · 0.92
ValidateMethod · 0.92
ValidateMethod · 0.92
ValidateMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected