From 0b39c44526fa300bb9341edd1e11fa71e7cdcd74 Mon Sep 17 00:00:00 2001 From: Jonatas Baldin Date: Mon, 15 Apr 2019 11:48:35 +0100 Subject: [PATCH] Fix unset key and comment block --- docs/content/recipes/gin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/recipes/gin.md b/docs/content/recipes/gin.md index dd8aa840b58..e793575031c 100644 --- a/docs/content/recipes/gin.md +++ b/docs/content/recipes/gin.md @@ -74,7 +74,7 @@ r.Use(GinContextToContextMiddleware()) Define a function to recover the `gin.Context` from the `context.Context` struct: ```go func GinContextFromContext(ctx context.Context) (*gin.Context, error) { - ginContext := ctx.Value(GinContextKey) + ginContext := ctx.Value("GinContextKey") if ginContext == nil { err := fmt.Errorf("could not retrieve gin.Context") return nil, err @@ -97,6 +97,6 @@ func (r *resolver) Todo(ctx context.Context) (*Todo, error) { return nil, err } - # ... + // ... } ``` \ No newline at end of file