-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Milestone
Description
probably ParseMediaType should split the type in half. it is easier to write x+"/"+y than to take "x/y" apart. ---------- Forwarded message ---------- From: devil <jdevilliers@gmail.com> Date: Thu, Oct 27, 2011 at 02:30 Subject: [go-nuts] mime media type manipulation To: golang-nuts <golang-nuts@googlegroups.com> Hi I am am doing some work that requires me to take apart mime media type values, possibly change some of the parameters, and then put the whole thing back together again. To this end, the go mime package provides 2 functions, namely func ParseMediaType(v string) (mediatype string, params map[string]string, err os.Error) and func FormatMediaType(t, sub string, param map[string]string) string Unfortunately, FormatMediaType requires the media type value to be broken down into a type and a subtype, while ParseMediaType returns a single string containing the type and subtype. Of course it is not rocket science to do that bit of manipulation myself, but it would be more convenient (to me, at least :-) if these two functions were consistent with each other. Regards Johan