type mime … // insertMime adds a mime to a list and keeps it sorted by quality. func insertMime(l []mime, e mime) []mime { … } const qFactorWeightingKey … // sortedMimes returns a list of mime sorted (desc) by its specified quality. // e.g. text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 func sortedMimes(accept string) (sorted []mime) { … }