Last active
December 27, 2021 00:22
-
-
Save yeknava/cde608416899a9070155 to your computer and use it in GitHub Desktop.
Golang get cookie by name
I think it's better to take a value without a loop.
From request. r.Cookie("name")
// Cookie returns the named cookie provided in the request or
// ErrNoCookie if not found.
I think it's better to take a value without a loop.
From request. r.Cookie("name")// Cookie returns the named cookie provided in the request or
// ErrNoCookie if not found.
its pretty old code. thanks for mentioning that method
Thanks @460s , was looking for this everywhere
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would add break after first found (line 7).