Skip to content

Commit 471b44c

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

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

Diff for: source/includes/fundamentals/code-snippets/gridfs.go

+5
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)