Skip to content

Instantly share code, notes, and snippets.

@jonnyreeves
Created February 4, 2016 09:50
Show Gist options
  • Save jonnyreeves/17f91155a0d4a5d296d6 to your computer and use it in GitHub Desktop.
Save jonnyreeves/17f91155a0d4a5d296d6 to your computer and use it in GitHub Desktop.
Testing Cookie Writes in Golang
@Justin2997
Copy link

Justin2997 commented Jun 25, 2020

This solution is not adapter for new version of golang. You will have :

recorder.HeaderMap is deprecated: HeaderMap exists for historical compatibility and should not be used. To access the headers returned by a handler, use the Response.Header map as returned by the Result method.

You should use :
recorder.Result().Cookies()[0] as @mfhholmes mentionne.

You can get the value with : recorder.Result().Cookies()[0].Value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment