MCPcopy Create free account
hub / github.com/git-bug/git-bug / ValidUrl

Function ValidUrl

util/text/validate.go:49–56  ·  view source on GitHub ↗

ValidUrl will tell if the string contains what seems to be a valid URL

(s string)

Source from the content-addressed store, hash-verified

47
48// ValidUrl will tell if the string contains what seems to be a valid URL
49func ValidUrl(s string) bool {
50 if strings.Contains(s, "\n") {
51 return false
52 }
53
54 _, err := url.ParseRequestURI(s)
55 return err == nil
56}

Callers 1

ValidateMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected