From 29f43e246ec41ee311a0a9bc24b15cb4ece4e513 Mon Sep 17 00:00:00 2001 From: Eyal Posener Date: Fri, 5 Jul 2019 14:58:49 +0300 Subject: deprecate match package --- match/file.go | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 match/file.go (limited to 'match/file.go') diff --git a/match/file.go b/match/file.go deleted file mode 100644 index 051171e..0000000 --- a/match/file.go +++ /dev/null @@ -1,19 +0,0 @@ -package match - -import "strings" - -// File returns true if prefix can match the file -func File(file, prefix string) bool { - // special case for current directory completion - if file == "./" && (prefix == "." || prefix == "") { - return true - } - if prefix == "." && strings.HasPrefix(file, ".") { - return true - } - - file = strings.TrimPrefix(file, "./") - prefix = strings.TrimPrefix(prefix, "./") - - return strings.HasPrefix(file, prefix) -} -- cgit v1.2.3