golang-lru
golang-lru copied to clipboard
implement GetOrAdd to LRU
Sometimes there would be a case where we want to get the value while updating the recent-ness and add the value if it's not found. PeekOrAdd does have similar logic but does not update the recent-ness, hence this PR.