diff options
| author | Adnan Maolood <[email protected]> | 2021-01-14 22:25:07 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-01-14 22:25:09 -0500 |
| commit | ad18ae601c63e614489bff6002c0753900327a3f (patch) | |
| tree | bd2a30ef6d9694f93cfe232e6a16f928d8499eef | |
| parent | fs: Update comments (diff) | |
| download | go-gemini-ad18ae601c63e614489bff6002c0753900327a3f.tar.xz go-gemini-ad18ae601c63e614489bff6002c0753900327a3f.zip | |
fs: Don't panic on mime.AddExtensionType error
It's probably best not to panic if this fails.
| -rw-r--r-- | fs.go | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -10,13 +10,8 @@ import ( func init() { // Add Gemini mime types - if err := mime.AddExtensionType(".gmi", "text/gemini"); err != nil { - panic(fmt.Errorf("failed to register .gmi extension mimetype: %w", err)) - } - - if err := mime.AddExtensionType(".gemini", "text/gemini"); err != nil { - panic(fmt.Errorf("failed to register .gemini extension mimetype: %w", err)) - } + mime.AddExtensionType(".gmi", "text/gemini") + mime.AddExtensionType(".gemini", "text/gemini") } // FileServer takes a filesystem and returns a Responder which uses that filesystem. |