func MyHandler(ctx *middleware.Context) { // Access values set by middleware value := ctx.Data["key"] // Set values to be accessed by later middleware or endpoint handlers ctx.Data["key"] = "value" // Write response ctx.Resp.WriteHeader(http.StatusOK) ctx.Resp.Write([]byte("Hello world")) } func MiddlewareFunc(ctx *middleware.Context) { // Do some processing... ctx.Data["key"] = "value" // Call next middleware function or endpoint handler ctx.Next() }In the above example, `MyHandler` is an endpoint handler that receives a context object as input parameter. The `MiddlewareFunc` function is a middleware function that runs before the endpoint handler. It sets a value in the context object and calls `ctx.Next()` to proceed with the next middleware or endpoint handler in the chain. The `Context` middleware is part of the `gogs` package library, a Git hosting system written in Go.