Skip to content

Commit

Permalink
Specify that there is no buffering done when reading inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-vasile committed Feb 18, 2024
1 parent f8b7d47 commit a3a04e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mimetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func EqualsAny(s string, mimes ...string) bool {
// SetLimit sets the maximum number of bytes read from input when detecting the MIME type.
// Increasing the limit provides better detection for file formats which store
// their magical numbers towards the end of the file: docx, pptx, xlsx, etc.
// During detection data is read in a single block of size limit, i.e. it is not buffered.
// A limit of 0 means the whole input file will be used.
func SetLimit(limit uint32) {
// Using atomic because readLimit can be read at the same time in other goroutine.
Expand Down

0 comments on commit a3a04e6

Please sign in to comment.