forked from mirror/gin
use comma ok and use single line (#984)
This commit is contained in:
parent
34e972e155
commit
e0fd6238d3
10
context.go
10
context.go
|
@ -562,15 +562,7 @@ func (c *Context) GetRawData() ([]byte, error) {
|
||||||
return ioutil.ReadAll(c.Request.Body)
|
return ioutil.ReadAll(c.Request.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) SetCookie(
|
func (c *Context) SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool) {
|
||||||
name string,
|
|
||||||
value string,
|
|
||||||
maxAge int,
|
|
||||||
path string,
|
|
||||||
domain string,
|
|
||||||
secure bool,
|
|
||||||
httpOnly bool,
|
|
||||||
) {
|
|
||||||
if path == "" {
|
if path == "" {
|
||||||
path = "/"
|
path = "/"
|
||||||
}
|
}
|
||||||
|
|
3
gin.go
3
gin.go
|
@ -26,8 +26,7 @@ type HandlersChain []HandlerFunc
|
||||||
|
|
||||||
// Last returns the last handler in the chain. ie. the last handler is the main own.
|
// Last returns the last handler in the chain. ie. the last handler is the main own.
|
||||||
func (c HandlersChain) Last() HandlerFunc {
|
func (c HandlersChain) Last() HandlerFunc {
|
||||||
length := len(c)
|
if length := len(c); length > 0 {
|
||||||
if length > 0 {
|
|
||||||
return c[length-1]
|
return c[length-1]
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue