Update context.go

This commit is contained in:
Mohammed Salah 2021-11-30 18:16:15 +02:00 committed by GitHub
parent bc2417fc40
commit 35c8f99bb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -415,7 +415,7 @@ func (c *Context) Query(key string) (value string) {
// c.DefaultQuery("name", "unknown") == "Manu" // c.DefaultQuery("name", "unknown") == "Manu"
// c.DefaultQuery("id", "none") == "none" // c.DefaultQuery("id", "none") == "none"
// c.DefaultQuery("lastname", "none") == "" // c.DefaultQuery("lastname", "none") == ""
func (c *Context) DefaultQuery(key, defaultValue string) string { func (c *Context) DefaultQuery(key, defaultValue interface{}) interface{} {
if value, ok := c.GetQuery(key); ok { if value, ok := c.GetQuery(key); ok {
return value return value
} }