Closed
Description
What version of Go are you using (go version
)?
go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
I wanted to extract cookies struct from a cookie header string.
I had to type this piece of code:
req := http.Request{Header: http.Header{"Cookie": []string{raw}}}
cookies := req.Cookies()
It felt kind of workaround.
What did you expect to see?
Have the appropriate method in the net/http
package that is public and parses cookie headers to a []*Cookie
struct.
For example:
func ParseCookies(raw string) []*Cookie {
...
}
What did you see instead?
Nothing.