From 2ada93a6dff49eb212acf5d7faf2f6d9cfca729b Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 18 Jan 2017 19:20:47 +0200 Subject: [PATCH] Document that the cookie passed to ResponseHeader.SetCookie may be re-used after the function returns --- header.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/header.go b/header.go index 524ee67..71c731c 100644 --- a/header.go +++ b/header.go @@ -946,6 +946,8 @@ func (h *ResponseHeader) SetCanonical(key, value []byte) { } // SetCookie sets the given response cookie. +// +// It is save re-using the cookie after the function returns. func (h *ResponseHeader) SetCookie(cookie *Cookie) { h.cookies = setArgBytes(h.cookies, cookie.Key(), cookie.Cookie()) }