main: handle glob errors in getFile (MR 22)
ignoring this was proooobably fine, but just in case...
This commit is contained in:
5
main.go
5
main.go
@@ -255,7 +255,10 @@ func getFiles(list []string, required bool) (files []string, err error) {
|
|||||||
|
|
||||||
func getFile(file string, required bool) (files []string, err error) {
|
func getFile(file string, required bool) (files []string, err error) {
|
||||||
// Expand glob expression
|
// Expand glob expression
|
||||||
expanded, _ := filepath.Glob(file)
|
expanded, err := filepath.Glob(file)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if len(expanded) > 0 && expanded[0] != file {
|
if len(expanded) > 0 && expanded[0] != file {
|
||||||
for _, path := range expanded {
|
for _, path := range expanded {
|
||||||
if globFiles, err := getFile(path, required); err != nil {
|
if globFiles, err := getFile(path, required); err != nil {
|
||||||
|
Reference in New Issue
Block a user