Get returns the requested item, or sets exists=false.
(obj interface{})
| 280 | |
| 281 | // Get returns the requested item, or sets exists=false. |
| 282 | func (h *Heap) Get(obj interface{}) (interface{}, bool, error) { |
| 283 | key, err := h.data.keyFunc(obj) |
| 284 | if err != nil { |
| 285 | return nil, false, KeyError{obj, err} |
| 286 | } |
| 287 | return h.GetByKey(key) |
| 288 | } |
| 289 | |
| 290 | // GetByKey returns the requested item, or sets exists=false. |
| 291 | func (h *Heap) GetByKey(key string) (interface{}, bool, error) { |