View definition

(*Context).DefaultQuery

Defined in github.com/gin-gonic/gin/context.go

Description

DefaultQuery returns the keyed url query value if it exists, othewise it returns the specified defaultValue string. See: Query() and GetQuery() for further information.

GET /?name=Manu&lastname=
c.DefaultQuery("name", "unknown") == "Manu"
c.DefaultQuery("id", "none") == "none"
c.DefaultQuery("lastname", "none") == ""

DefaultQuery is referenced in 22 repositories

github.com/gin-gonic/gin github.com/schollz/find github.com/dz0ny/champ

...