11// Package mimetype uses magic number signatures to detect the MIME type of a file.
22//
3- // File formats are stored in a hierarchy with application/octet-stream at its root.
3+ // File formats are stored in a hierarchy with " application/octet-stream" at its root.
44// For example, the hierarchy for HTML format is application/octet-stream ->
55// text/plain -> text/html.
66package mimetype
@@ -19,7 +19,7 @@ var readLimit uint32 = defaultLimit
1919
2020// Detect returns the MIME type found from the provided byte slice.
2121//
22- // The result is always a valid MIME type, with application/octet-stream
22+ // The result is always a valid MIME type, with " application/octet-stream"
2323// returned when identification failed.
2424func Detect (in []byte ) * MIME {
2525 // Using atomic because readLimit can be written at the same time in other goroutine.
@@ -34,7 +34,7 @@ func Detect(in []byte) *MIME {
3434
3535// DetectReader returns the MIME type of the provided reader.
3636//
37- // The result is always a valid MIME type, with application/octet-stream
37+ // The result is always a valid MIME type, with " application/octet-stream"
3838// returned when identification failed with or without an error.
3939// Any error returned is related to the reading from the input reader.
4040//
@@ -72,7 +72,7 @@ func DetectReader(r io.Reader) (*MIME, error) {
7272
7373// DetectFile returns the MIME type of the provided file.
7474//
75- // The result is always a valid MIME type, with application/octet-stream
75+ // The result is always a valid MIME type, with " application/octet-stream"
7676// returned when identification failed with or without an error.
7777// Any error returned is related to the opening and reading from the input file.
7878func DetectFile (path string ) (* MIME , error ) {
@@ -112,7 +112,7 @@ func SetLimit(limit uint32) {
112112}
113113
114114// Extend adds detection for other file formats.
115- // It is equivalent to calling Extend() on the root MIME type "application/octet-stream".
115+ // It is equivalent to calling [MIME. Extend] on the root MIME type "application/octet-stream".
116116func Extend (detector func (raw []byte , limit uint32 ) bool , mime , extension string , aliases ... string ) {
117117 root .Extend (detector , mime , extension , aliases ... )
118118}
0 commit comments