status-go/vendor/github.com/anacrolix/missinggo/mime/mime.go

19 lines
268 B
Go
Raw Normal View History

2022-03-10 09:44:48 +00:00
package mime
import "strings"
type Type struct {
Class string
Specific string
}
func (t Type) String() string {
return t.Class + "/" + t.Specific
}
func (t *Type) FromString(s string) {
ss := strings.SplitN(s, "/", 1)
t.Class = ss[0]
t.Specific = ss[1]
}