MCPcopy Create free account
hub / github.com/LunaSource/Luna / FileMatchesPattern

Function FileMatchesPattern

utils/utils.go:7–15  ·  view source on GitHub ↗
(filename, pattern string)

Source from the content-addressed store, hash-verified

5)
6
7func FileMatchesPattern(filename, pattern string) bool {
8 matched, _ := filepath.Match(pattern, filepath.Base(filename))
9 if matched {
10 return true
11 }
12 fullPattern := filepath.FromSlash(pattern)
13 matched, _ = filepath.Match(fullPattern, filename)
14 return matched
15}
16
17func TruncateString(s string, maxLen int) string {
18 if len(s) <= maxLen {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected