[golang] How to set cookie under gin

setcookie example:
import ( 

func main() { 
 router := gin.Default() 
 router.GET("/cookie", func(c *gin.Context) { 
  // 设置cookie 
  c.SetCookie("site_cookie", "cookievalue", 3600, "/", "localhost", false, true) 

func (c *Context) SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool) 
special note: domain string must be correct. if not , SetCookie will be not write into right place. 

source: https://www.tizi365.com/archives/273.html