Delete removes a state instance by key. The state won't be deleted if in use by a variable.
(ctx context.Context, key string)
| 101 | // |
| 102 | // The state won't be deleted if in use by a variable. |
| 103 | func (s *ShellStateStore) Delete(ctx context.Context, key string) { |
| 104 | if s.isUsed(ctx, key) { |
| 105 | return |
| 106 | } |
| 107 | s.mu.Lock() |
| 108 | delete(s.data, key) |
| 109 | s.mu.Unlock() |
| 110 | } |
| 111 | |
| 112 | // Load is like [Get] but returns an error if the key is not found or if |
| 113 | // the state represents an error. |
no test coverage detected