LookupWithFlags retrieves a value from a Map with flags. Passing LookupLock flag will look up the value of a spin-locked map without returning the lock. This must be specified if the elements contain a spinlock. Calls Close() on valueOut if it is of type **Map or **Program, and *valueOut is not ni
(key, valueOut any, flags MapLookupFlags)
| 849 | // |
| 850 | // Returns an error if the key doesn't exist, see ErrKeyNotExist. |
| 851 | func (m *Map) LookupWithFlags(key, valueOut any, flags MapLookupFlags) error { |
| 852 | if m.typ.hasPerCPUValue() { |
| 853 | return m.lookupPerCPU(key, valueOut, flags) |
| 854 | } |
| 855 | |
| 856 | valueBytes := makeMapSyscallOutput(valueOut, m.fullValueSize) |
| 857 | if err := m.lookup(key, valueBytes.Pointer(), flags); err != nil { |
| 858 | return err |
| 859 | } |
| 860 | |
| 861 | return m.unmarshalValue(valueOut, valueBytes) |
| 862 | } |
| 863 | |
| 864 | // LookupAndDelete retrieves and deletes a value from a Map. |
| 865 | // |