LookupAndDeleteWithFlags retrieves and deletes a value from a Map. Passing LookupLock flag will look up and delete the value of a spin-locked map without returning the lock. This must be specified if the elements contain a spinlock. Returns ErrKeyNotExist if the key doesn't exist.
(key, valueOut any, flags MapLookupFlags)
| 876 | // |
| 877 | // Returns ErrKeyNotExist if the key doesn't exist. |
| 878 | func (m *Map) LookupAndDeleteWithFlags(key, valueOut any, flags MapLookupFlags) error { |
| 879 | if m.typ.hasPerCPUValue() { |
| 880 | return m.lookupAndDeletePerCPU(key, valueOut, flags) |
| 881 | } |
| 882 | |
| 883 | valueBytes := makeMapSyscallOutput(valueOut, m.fullValueSize) |
| 884 | if err := m.lookupAndDelete(key, valueBytes.Pointer(), flags); err != nil { |
| 885 | return err |
| 886 | } |
| 887 | return m.unmarshalValue(valueOut, valueBytes) |
| 888 | } |
| 889 | |
| 890 | // LookupBytes gets a value from Map. |
| 891 | // |