(filename, pattern string)
| 5 | ) |
| 6 | |
| 7 | func 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 | |
| 17 | func TruncateString(s string, maxLen int) string { |
| 18 | if len(s) <= maxLen { |
nothing calls this directly
no outgoing calls
no test coverage detected