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