Skip to content

Commit

Permalink
Remove file after printing in printImage function
Browse files Browse the repository at this point in the history
  • Loading branch information
sschonss committed Jan 10, 2024
1 parent a8af4a3 commit e11a75e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ func printImage(w http.ResponseWriter, r *http.Request) {
return
}

err = os.Remove(imagePath)

Check failure on line 82 in main.go

View workflow job for this annotation

GitHub Actions / build

os.Remove undefined (type string has no field or method Remove)
if err != nil {
log.Printf("Error removing file: %s\n", err)
http.Error(w, "Failed to remove the file", http.StatusInternalServerError)
return
}

fmt.Fprintf(w, "Print request processed successfully.\n%s\n", output)
}

Expand Down

0 comments on commit e11a75e

Please sign in to comment.