1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-05-23 21:26:04 +02:00

fs: Don't panic on mime.AddExtensionType error

It's probably best not to panic if this fails.
This commit is contained in:
Adnan Maolood 2021-01-14 22:25:07 -05:00
parent 8473f3b9d4
commit ad18ae601c

9
fs.go
View File

@ -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.