Skip to content
Snippets Groups Projects
Verified Commit 43baeb5a authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

refactor: Refactor import statements and add error handling to check directory existence

- Remove unused import statement for "golang.org/x/exp/slices"
- Add necessary import statement for "golang.org/x/exp/slices"
- Implement error handling code to check directory existence
parent 8219efe8
Branches
Tags v1.16.0
No related merge requests found
......@@ -4,11 +4,12 @@
package configuration
import (
"golang.org/x/exp/slices"
"io/fs"
"os"
"path"
"path/filepath"
"golang.org/x/exp/slices"
)
type files struct {
......@@ -137,10 +138,12 @@ func (s *Settings[C]) sanitizeDirectories() {
visited[d] = true
}
if _, err := os.Stat(d); os.IsNotExist(err) {
s.errors = append(s.errors, newPathDoesNotExistError(d))
}
// check last entry
d := s.files.directories[len(s.files.directories)-1]
if _, err := os.Stat(d); os.IsNotExist(err) {
s.errors = append(s.errors, newPathDoesNotExistError(d))
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment