getUser reads the user id from the context.
(ctx context.Context)
| 117 | |
| 118 | // getUser reads the user id from the context. |
| 119 | func getUser(ctx context.Context) *models.User { |
| 120 | obj := ctx.Value(userKey) |
| 121 | if obj == nil { |
| 122 | return nil |
| 123 | } |
| 124 | return obj.(*models.User) |
| 125 | } |
| 126 | |
| 127 | // withSignature adds the provided request ID to the context. |
| 128 | func withSignature(ctx context.Context, id string) context.Context { |
no test coverage detected
searching dependent graphs…