From 8964813e0dbd0456d103a88ed254aa75228831dc Mon Sep 17 00:00:00 2001 From: Ryan Boehning Date: Sun, 14 Dec 2014 20:02:26 -0800 Subject: [PATCH] Update code sample for Go 1+ `time.LocalTime()` no longer exists. I've updated that line to the current syntax. --- en/06.1.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/en/06.1.md b/en/06.1.md index 48da2d80..866f13dd 100644 --- a/en/06.1.md +++ b/en/06.1.md @@ -60,8 +60,7 @@ Go uses the `SetCookie` function in the `net/http` package to set cookies: Here is an example of setting a cookie: - expiration := *time.LocalTime() - expiration.Year += 1 + expiration := time.Now().Add(365 * 24 * time.Hour) cookie := http.Cookie{Name: "username", Value: "astaxie", Expires: expiration} http.SetCookie(w, &cookie)