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

Function Empty

util/text/validate.go:11–17  ·  view source on GitHub ↗

Empty tell if the string is considered empty once space and not graphics characters are removed

(s string)

Source from the content-addressed store, hash-verified

9// Empty tell if the string is considered empty once space
10// and not graphics characters are removed
11func Empty(s string) bool {
12 trim := strings.TrimFunc(s, func(r rune) bool {
13 return unicode.IsSpace(r) || !unicode.IsGraphic(r)
14 })
15
16 return trim == ""
17}
18
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

Callers 6

ensureIssueMethod · 0.92
ensureTimelineItemMethod · 0.92
ValidateMethod · 0.92
ValidateMethod · 0.92
ValidateMethod · 0.92
ValidateMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected