MCPcopy Create free account
hub / github.com/bytebase/bytebase / HasPrefixes

Function HasPrefixes

backend/common/util.go:62–69  ·  view source on GitHub ↗

HasPrefixes returns true if the string s has any of the given prefixes.

(src string, prefixes ...string)

Source from the content-addressed store, hash-verified

60
61// HasPrefixes returns true if the string s has any of the given prefixes.
62func HasPrefixes(src string, prefixes ...string) bool {
63 for _, prefix := range prefixes {
64 if strings.HasPrefix(src, prefix) {
65 return true
66 }
67 }
68 return false
69}
70
71// GetPostgresSocketDir returns the postgres socket directory of Bytebase.
72func GetPostgresSocketDir() string {

Callers 3

defaultAPIRequestSkipperFunction · 0.92
TestHasPrefixesFunction · 0.85
NormalizeExternalURLFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestHasPrefixesFunction · 0.68