-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
by anton.hendriks:
After switching to the go 1.3 beta mime.FormatMediaType has started giving inconsistent
results. This is obviously a result of the map parameter and up till now we've just been
lucky to pass small enough maps that haven't been randomized.
The function produces output from a long chain of processing and having the output
consistent simplifies testing considerably. We usually solve this problem by iterating
over a sorted list of the map keys rather than the map itself.
Proposed fix. Replace line 34 of src/pkg/mime/mediatype.go with the following.
attributes := make([]string, 0, len(param))
for a, _ := range param {
attributes = append(attributes, a)
}
sort.Strings(attributes)
for attribute, _ := range attributes {
value := param[attribute]Reactions are currently unavailable