diff --git a/website/content/guide/context.md b/website/content/guide/context.md index eb2607aa..957aa3cd 100644 --- a/website/content/guide/context.md +++ b/website/content/guide/context.md @@ -12,8 +12,8 @@ description = "Context in Echo" `echo.Context` represents the context of the current HTTP request. It holds request and response reference, path, path parameters, data, registered handler and APIs to read -request and write response. Context is 100% compatible with standard `context.Context`. -As Context is an interface, it is easy to extend it with custom APIs. +request and write response. As Context is an interface, it is easy to extend it with +custom APIs. #### Extending Context @@ -56,20 +56,3 @@ e.Get("/", func(c echo.Context) error { return cc.String(200, "OK") }) ``` - -### Standard Context - -`echo.Context` embeds standard `context.Context` interface, so all it's functions -are available right from `echo.Context`. - -*Example* - -```go -e.GET("/users/:name", func(c echo.Context) error) { - c.SetContext(context.WithValue(nil, "key", "val")) - // Pass it down... - // Use it... - val := c.Value("key").(string) - return c.String(http.StatusOK, name) -}) -```