From 58aef8be0d386457fcb30c926099a74c6f30ef6a Mon Sep 17 00:00:00 2001 From: norareidy Date: Thu, 14 Nov 2024 14:34:50 -0500 Subject: [PATCH] DOCSP-45268: Close uploadStream in GridFS code --- source/includes/fundamentals/code-snippets/gridfs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/includes/fundamentals/code-snippets/gridfs.go b/source/includes/fundamentals/code-snippets/gridfs.go index 5c830cc3..27c3503e 100644 --- a/source/includes/fundamentals/code-snippets/gridfs.go +++ b/source/includes/fundamentals/code-snippets/gridfs.go @@ -52,5 +52,10 @@ func main() { panic(err) } fmt.Printf("New file uploaded with %d bytes written", bytes) + + // Calls the Close() method to write file metadata + if err := uploadStream.Close(); err != nil { + panic(err) + } // end OpenUploadStream example }