From 4181cd1c42aa6a5094725c19b1f868533959df60 Mon Sep 17 00:00:00 2001 From: realgam3 Date: Fri, 6 Sep 2019 18:05:07 +0300 Subject: [PATCH] Trying not to invent the wheel --- caplets/manager.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/caplets/manager.go b/caplets/manager.go index 99c84df2..984fc4c8 100644 --- a/caplets/manager.go +++ b/caplets/manager.go @@ -5,7 +5,6 @@ import ( "io/ioutil" "os" "path/filepath" - "runtime" "sort" "strings" "sync" @@ -26,10 +25,7 @@ func List() []*Caplet { for _, fileName := range append(files, files2...) { if _, err := os.Stat(fileName); err == nil { - base := strings.Replace(fileName, searchPath+"/", "", -1) - if runtime.GOOS == "windows" { - base = strings.Replace(fileName, searchPath+"\\", "", -1) - } + base := strings.Replace(fileName, searchPath+string(os.PathSeparator), "", -1) base = strings.Replace(base, Suffix, "", -1) if err, caplet := Load(base); err != nil {