negotiator.go
func (cn *ContentNegotiator) getEncoder(req *http.Request) Encoder {
	var result = cn.DefaultEncoder
	accept := req.Header.Get("Accept")

	for k, v := range cn.encoderMap {
		if strings.Contains(accept, k) {
			result = v
			break
		}
	}
	return result
}
func (cn *ContentNegotiator) getEncoder(req *http.Request) Encoder {
	var result = cn.DefaultEncoder
	accept := req.Header.Get("Accept")

	for k, v := range cn.encoderMap {
		if strings.Contains(accept, k) {
			result = v
			break
		}
	}
	return result
}
func ( cn * ContentNegotiator ) getEncoder ( req * http . Request ) Encoder { var result = cn . DefaultEncoder accept := req . Header . Get ( " " ) for k , v := range cn . encoderMap { if strings . Contains ( accept , k ) { result = v break } } return result }
// getEncoder parses the Accept header an returns the appropriate encoder to use
getEncoder parses the Accept header an returns the appropriate encoder to use