Skip to content

zhooravell/mime

Repository files navigation

GoLang MIME Types Utilities

This library provides functions to work with MIME types (also known as "media types").

License Build

Examples

package main

import (
	"github.com/zhooravell/mime"
	"log"
)

func main() {
	ext, _ := mime.GetExtensions("application/javascript")

	log.Println(ext)
	// Output: {"js", "jsm", "mjs"}

	mt, _ := mime.GetMimeTypes("yml")

	log.Println(mt)
	// Output: {"application/x-yaml", "text/yaml", "text/x-yaml"}
}

Source(s)