From f8fa5a04dc942d57df4c007b06c33fed2af8ba99 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 7 Sep 2020 15:01:34 -0400 Subject: [PATCH] use strings.TrimPrefix instead of Replace when checking paths --- ui/ignore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/ignore.go b/ui/ignore.go index 348b020..8202783 100644 --- a/ui/ignore.go +++ b/ui/ignore.go @@ -10,7 +10,7 @@ import ( // in a dot directory and browsing files beneath this function won't return // true every time. func isDotFileOrDir(cwd, path string) bool { - p := strings.Replace(path, cwd, "", 1) + p := strings.TrimPrefix(path, cwd) for _, v := range strings.Split(p, string(os.PathSeparator)) { if len(v) > 0 && v[0] == '.' { return true