fix tmp folder creation
This commit is contained in:
@@ -41,9 +41,13 @@ func main() {
|
||||
|
||||
// create temp folder
|
||||
path := "./tmp"
|
||||
if err := os.MkdirAll(path, os.ModePerm); err != nil {
|
||||
fmt.Printf("Error creating temp folder: %v\n", err)
|
||||
return
|
||||
if os.IsExist(os.Mkdir(path, os.ModePerm)) {
|
||||
fmt.Printf("Temp folder already exists, skipping creation\n")
|
||||
} else {
|
||||
if err := os.MkdirAll(path, os.ModePerm); err != nil {
|
||||
fmt.Printf("Error creating temp folder: %v\n", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
r := gin.Default()
|
||||
|
||||
Reference in New Issue
Block a user