Trying not to invent the wheel

This commit is contained in:
realgam3 2019-09-06 18:05:07 +03:00
commit 4181cd1c42

View file

@ -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 {