mirror of
https://github.com/NotAShelf/catApi.git
synced 2025-02-22 19:38:21 +00:00
handle missing images directory
This commit is contained in:
parent
750162d8c5
commit
bae551520a
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
@ -66,7 +66,12 @@ func getImages() []string {
|
|||
if err != nil {
|
||||
logger.WithError(err).Fatal("Error reading images directory")
|
||||
}
|
||||
var images []string
|
||||
|
||||
if len(files) == 0 {
|
||||
logger.Warn("No images found in the images directory")
|
||||
}
|
||||
|
||||
var images []string
|
||||
for _, file := range files {
|
||||
images = append(images, file.Name())
|
||||
logger.Info("Loaded image:", file.Name())
|
||||
|
|
Loading…
Add table
Reference in a new issue