1
0
mirror of https://github.com/golang/go synced 2024-11-23 00:10:07 -07:00

mime: document use of the Shared MIME-Info Database

For #44513.
Fixes #46013.

Change-Id: I382603208aa94b66d5220cf0f418b8528a4e4148
Reviewed-on: https://go-review.googlesource.com/c/go/+/322892
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Damien Neil 2021-05-26 13:43:15 -07:00
parent a92460fd2f
commit 02beecb397
2 changed files with 7 additions and 3 deletions

View File

@ -408,7 +408,9 @@ Do not send CLs removing the interior tags from such phrases.
<dl id="mime"><dt><a href="/pkg/mime/">mime</a></dt>
<dd>
<p><!-- CL 305230 -->
TODO: <a href="https://golang.org/cl/305230">https://golang.org/cl/305230</a>: support reading shared mime-info database on unix systems
On Unix systems, the table of MIME types is now read from the local system's
<a href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.21.html">Shared MIME-info Database</a>
when available.
</p>
</dd>
</dl><!-- mime -->

View File

@ -96,9 +96,11 @@ func initMime() {
// Extensions are looked up first case-sensitively, then case-insensitively.
//
// The built-in table is small but on unix it is augmented by the local
// system's mime.types file(s) if available under one or more of these
// names:
// system's MIME-info database or mime.types file(s) if available under one or
// more of these names:
//
// /usr/local/share/mime/globs2
// /usr/share/mime/globs2
// /etc/mime.types
// /etc/apache2/mime.types
// /etc/apache/mime.types