Delete removes the value with key from the environment. Example: env := NewEnvironment(t) env.Put("key1", "str") env.Delete("key1")
(key string)
| 76 | // env.Put("key1", "str") |
| 77 | // env.Delete("key1") |
| 78 | func (e *Environment) Delete(key string) { |
| 79 | opChain := e.chain.enter("Delete(%q)", key) |
| 80 | defer opChain.leave() |
| 81 | |
| 82 | e.mu.Lock() |
| 83 | defer e.mu.Unlock() |
| 84 | |
| 85 | delete(e.data, key) |
| 86 | } |
| 87 | |
| 88 | // Clear will delete all key value pairs from the environment |
| 89 | // |