encoding/encoder.go
func (e *Encoder) Parser(r *http.Request) Parser {
	contentType := r.Header.Get("Content-Type")
	info := parseMimeInfo(contentType)

	if info != nil {
		for encoding, i := range e.encodings {
			if i.equals(info) {
				return encoding
			}
		}
	}

	return e.defaultEncoding
}
func (e *Encoder) Parser(r *http.Request) Parser {
	contentType := r.Header.Get("Content-Type")
	info := parseMimeInfo(contentType)

	if info != nil {
		for encoding, i := range e.encodings {
			if i.equals(info) {
				return encoding
			}
		}
	}

	return e.defaultEncoding
}
// Parser returns a parser based on the mime, if none can be matched the
// default is returned