creationStateFromContext gets the creationState from the context. It assumes the context contains a valid value.
(ctx context.Context)
| 58 | // creationStateFromContext gets the creationState from the context. |
| 59 | // It assumes the context contains a valid value. |
| 60 | func creationStateFromContext(ctx context.Context) *creationState { |
| 61 | return ctx.Value(ctxCreationStateContextKey).(*creationState) |
| 62 | } |
| 63 | |
| 64 | // putToPreparation adds the given name to the in-creation map. |
| 65 | // Returns an error if it's already there (to prevent circular creation). |