Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
apriil15 committed Jan 4, 2023
1 parent a144662 commit 8271619
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions docs/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2108,15 +2108,13 @@ func main() {
router := gin.Default()

router.GET("/cookie", func(c *gin.Context) {
cookie, err := c.Cookie("gin_cookie")
if err != nil {
cookie = "NotSet"
c.SetCookie("gin_cookie", "test", 3600, "/", "localhost", false, true)
}

cookie, err := c.Cookie("gin_cookie")

if err != nil {
cookie = "NotSet"
c.SetCookie("gin_cookie", "test", 3600, "/", "localhost", false, true)
}

fmt.Printf("Cookie value: %s \n", cookie)
fmt.Printf("Cookie value: %s \n", cookie)
})

router.Run()
Expand Down

0 comments on commit 8271619

Please sign in to comment.