Skip to content

Commit 71efece

Browse files
authored
DOCSP-45268: Close uploadStream in GridFS code (#405)
1 parent b9e8f82 commit 71efece

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
@@ -52,5 +52,10 @@ func main() {
5252
panic(err)
5353
}
5454
fmt.Printf("New file uploaded with %d bytes written", bytes)
55+
56+
// Calls the Close() method to write file metadata
57+
if err := uploadStream.Close(); err != nil {
58+
panic(err)
59+
}
5560
// end OpenUploadStream example
5661
}

0 commit comments

Comments
 (0)