summaryrefslogtreecommitdiff
path: root/match/file.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2019-07-05 17:33:47 +0300
committerGitHub <[email protected]>2019-07-05 17:33:47 +0300
commit2f2ff270a9f6adcef8351b1bdf5319b5d612b53f (patch)
tree0dbc83883d33ac239db651f19be3fe67fd3dc361 /match/file.go
parent6ffe496ea9530c0638974624ed9dd429f9ad592e (diff)
parent72c5c945f0d5861ba1d4e51a0a5ac36a4bef3868 (diff)
Merge pull request #98 from posener/refactor
Some refactorings
Diffstat (limited to 'match/file.go')
-rw-r--r--match/file.go19
1 files changed, 0 insertions, 19 deletions
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)
-}