Skip to content

Commit

Permalink
docs: amend signature (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqqqq777 authored Sep 22, 2023
1 parent 8904972 commit a924461
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/app/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ func (ctx *RequestContext) String(code int, format string, values ...interface{}
// FullPath returns a matched route full path. For not found routes
// returns an empty string.
//
// router.GET("/user/:id", func(c *hertz.RequestContext) {
// c.FullPath() == "/user/:id" // true
// router.GET("/user/:id", func(c context.Context, ctx *app.RequestContext) {
// ctx.FullPath() == "/user/:id" // true
// })
func (ctx *RequestContext) FullPath() string {
return ctx.fullPath
Expand Down Expand Up @@ -989,9 +989,9 @@ func (ctx *RequestContext) GetStringMapStringSlice(key string) (smss map[string]
// Param returns the value of the URL param.
// It is a shortcut for c.Params.ByName(key)
//
// router.GET("/user/:id", func(c *hertz.RequestContext) {
// router.GET("/user/:id", func(c context.Context, ctx *app.RequestContext) {
// // a GET request to /user/john
// id := c.Param("id") // id == "john"
// id := ctx.Param("id") // id == "john"
// })
func (ctx *RequestContext) Param(key string) string {
return ctx.Params.ByName(key)
Expand Down

0 comments on commit a924461

Please sign in to comment.