Skip to content

Commit

Permalink
Merge pull request #678 from jonatasbaldin/gin-context-recipe
Browse files Browse the repository at this point in the history
Fix unset key and comment block at Gin recipe docs
  • Loading branch information
vektah authored Apr 15, 2019
2 parents 5aa6a20 + 0b39c44 commit 1c95d42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/recipes/gin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -97,6 +97,6 @@ func (r *resolver) Todo(ctx context.Context) (*Todo, error) {
return nil, err
}

# ...
// ...
}
```

0 comments on commit 1c95d42

Please sign in to comment.