use full file paths in file listing
This commit is contained in:
parent
64972dd953
commit
76ff27a9a6
|
@ -2,6 +2,7 @@ package goutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
@ -28,7 +29,7 @@ func ListFilesExt(dir string, ext string) []string {
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
if !file.IsDir() {
|
if !file.IsDir() {
|
||||||
if strings.ToUpper(filepath.Ext(file.Name())) == ext {
|
if strings.ToUpper(filepath.Ext(file.Name())) == ext {
|
||||||
list = append(list, file.Name())
|
list = append(list, path.Join(dir, file.Name()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user