Skip to content

Commit 5a1c41f

Browse files
committed
DOCSP-45268: Close uploadStream in GridFS code (#405)
(cherry picked from commit 71efece)
1 parent b9e7cef commit 5a1c41f

File tree

1 file changed

+5
-0
lines changed
  • source/includes/fundamentals/code-snippets

1 file changed

+5
-0
lines changed

source/includes/fundamentals/code-snippets/gridfs.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,10 @@ func main() {
5151
panic(err)
5252
}
5353
fmt.Printf("New file uploaded with %d bytes written", bytes)
54+
55+
// Calls the Close() method to write file metadata
56+
if err := uploadStream.Close(); err != nil {
57+
panic(err)
58+
}
5459
// end OpenUploadStream example
5560
}

0 commit comments

Comments
 (0)