Extract is like [Load] but also deletes the state from memory. This is expected to be used when the state is being resolved rather than just passed around.
(ctx context.Context, key string)
| 129 | // This is expected to be used when the state is being resolved rather than |
| 130 | // just passed around. |
| 131 | func (s *ShellStateStore) Extract(ctx context.Context, key string) (*ShellState, error) { |
| 132 | defer s.Delete(ctx, key) |
| 133 | return s.Load(key) |
| 134 | } |
| 135 | |
| 136 | // isUsed returns true if a state key is being used in a variable. |
| 137 | func (s *ShellStateStore) isUsed(ctx context.Context, key string) bool { |