From f63d1b599c87339777e6a24ca6d02879e20e7778 Mon Sep 17 00:00:00 2001 From: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com> Date: Sun, 22 Mar 2026 01:09:49 +0100 Subject: [PATCH] refactor: simplify `isExecutable` (#2450) --- os_windows.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/os_windows.go b/os_windows.go index 7ac223e0..460d2668 100644 --- a/os_windows.go +++ b/os_windows.go @@ -7,6 +7,7 @@ import ( "os/exec" "os/user" "path/filepath" + "slices" "strings" "syscall" @@ -185,13 +186,7 @@ func isExecutable(f os.FileInfo) bool { if ext == "" { return false } - ext = strings.ToLower(ext) - for _, x := range envPathExts { - if ext == x { - return true - } - } - return false + return slices.Contains(envPathExts, strings.ToLower(ext)) } func isHidden(f os.FileInfo, path string, hiddenfiles []string) bool {