mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:20:55 +00:00
code simplify
This commit is contained in:
parent
46fbeaadad
commit
bc2195b07f
@ -93,7 +93,7 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface
|
|||||||
|
|
||||||
if maxAge > 0 {
|
if maxAge > 0 {
|
||||||
fmt.Fprintf(&b, "; Expires=%s; Max-Age=%d", time.Now().Add(time.Duration(maxAge)*time.Second).UTC().Format(time.RFC1123), maxAge)
|
fmt.Fprintf(&b, "; Expires=%s; Max-Age=%d", time.Now().Add(time.Duration(maxAge)*time.Second).UTC().Format(time.RFC1123), maxAge)
|
||||||
} else if maxAge <= 0 {
|
} else {
|
||||||
fmt.Fprintf(&b, "; Max-Age=0")
|
fmt.Fprintf(&b, "; Max-Age=0")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user