MCPcopy
hub / github.com/lxc/incus / StringHasPrefix

Function StringHasPrefix

shared/util/string.go:59–66  ·  view source on GitHub ↗

StringHasPrefix returns true if value has one of the supplied prefixes.

(value string, prefixes ...string)

Source from the content-addressed store, hash-verified

57
58// StringHasPrefix returns true if value has one of the supplied prefixes.
59func StringHasPrefix(value string, prefixes ...string) bool {
60 for _, prefix := range prefixes {
61 if strings.HasPrefix(value, prefix) {
62 return true
63 }
64 }
65 return false
66}
67
68// StringPrefixInSlice returns true if any element in the list has the given prefix.
69func StringPrefixInSlice(key string, list []string) bool {

Callers 4

ValidNameFunction · 0.92
ValidNameFunction · 0.92
BackupVolumeFunction · 0.92
UpdateMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…