Skip to content

Commit

Permalink
DOCSP-45268: Close uploadStream in GridFS code (#405)
Browse files Browse the repository at this point in the history
(cherry picked from commit 71efece)
  • Loading branch information
norareidy committed Nov 15, 2024
1 parent e6e9e7a commit 471b44c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/includes/fundamentals/code-snippets/gridfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,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
}

0 comments on commit 471b44c

Please sign in to comment.