litl / mime

A simple Go package that extends the standard library's mime package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mime

mime is a simple Go package that extends the mime package from the standard library with:

  • A mime.Type type, that represents a MIME Type
  • A mime.DefaultExtension function, which returns an extension given a mime.Type

Example

package main

import (
	"fmt"
	"github.com/litl/mime"
)

func main() {
	t := mime.Type("video/x-matroska")
	fmt.Printf("Type %s has default extension %s\n", t, t.DefaultExtension())
}

About

A simple Go package that extends the standard library's mime package

License:MIT License


Languages

Language:Go 100.0%