fix pass []any as any in variadic function by asasalint (#5012)

* fix pass []any as any in variadic function

* add change log
This commit is contained in:
alingse
2022-07-10 14:39:46 +08:00
committed by GitHub
parent 493e7db20b
commit 890caddfb3
6 changed files with 7 additions and 6 deletions

View File

@@ -78,7 +78,7 @@ func (ctx *Context) GetCookie(key string) string {
// SetCookie Set cookie for response.
// It's alias of BeegoOutput.Cookie.
func (ctx *Context) SetCookie(name string, value string, others ...interface{}) {
(*context.Context)(ctx).SetCookie(name, value, others)
(*context.Context)(ctx).SetCookie(name, value, others...)
}
// GetSecureCookie Get secure cookie from request by a given key.
@@ -88,7 +88,7 @@ func (ctx *Context) GetSecureCookie(Secret, key string) (string, bool) {
// SetSecureCookie Set Secure cookie for response.
func (ctx *Context) SetSecureCookie(Secret, name, value string, others ...interface{}) {
(*context.Context)(ctx).SetSecureCookie(Secret, name, value, others)
(*context.Context)(ctx).SetSecureCookie(Secret, name, value, others...)
}
// XSRFToken creates a xsrf token string and returns.

View File

@@ -47,7 +47,7 @@ func (output *BeegoOutput) Body(content []byte) error {
// Cookie sets cookie value via given key.
// others are ordered as cookie's max age time, path,domain, secure and httponly.
func (output *BeegoOutput) Cookie(name string, value string, others ...interface{}) {
(*context.BeegoOutput)(output).Cookie(name, value, others)
(*context.BeegoOutput)(output).Cookie(name, value, others...)
}
// JSON writes json to response body.