From 15d8d08c22455227bbee03cdd9574fb9bff1c3cf Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Sat, 3 Feb 2024 16:38:30 -0800 Subject: [PATCH] backend: Blob storage package documentation, close error check --- backend/app/api/handlers/v1/v1_ctrl_items_attachments.go | 4 +++- backend/internal/core/blobstore/store.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go b/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go index 1fa22f1..08cfc65 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go +++ b/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go @@ -165,7 +165,9 @@ func (ctrl *V1Controller) handleItemAttachmentsHandler(w http.ResponseWriter, r return validate.NewRequestError(err, http.StatusInternalServerError) } - defer content.Close() + defer func() { + _ = content.Close() + }() buf, err := io.ReadAll(content) if err != nil { diff --git a/backend/internal/core/blobstore/store.go b/backend/internal/core/blobstore/store.go index 33fdb3f..e1bac10 100644 --- a/backend/internal/core/blobstore/store.go +++ b/backend/internal/core/blobstore/store.go @@ -1,3 +1,4 @@ +// Package blobstore provides blob storage abstractions for reading and writing binary blobs. package blobstore import (