eeg*_*loo 3 cookies google-app-engine go

作为Golang的新手,尝试在浏览器上设置cookie,有简单的基本代码,但它根本不起作用并进行了一些谷歌搜索并找到了一些stackoverflow ex.但仍然没有采取正确的方式.

hello.go
package main

import "io"
import "net/http"
import "time"

func handler(w http.ResponseWriter, req *http.Request) {
    expire := time.Now().AddDate(0, 0, 1)
    cookie := http.Cookie{"test", "tcookie", "/", "www.dummy.com", expire, expire.Format(time.UnixDate), 86400, true, true, "test=tcookie", []string{"test=tcookie"}}
    req.AddCookie(&cookie)
    io.WriteString(w, "Hello world!")
}

func main() {
    http.HandleFunc("/", handler)
}
\hello.go:9:15: composite struct literal net/http.Cookie with untagged fields

任何人都可以建议我或给我一些基本的例子(详细说明)来设置cookie.

几乎没有搜索SO并找到.. 在Golang中设置Cookie(net/http)但不能正确地接收它...

谢谢.