如何概括此地图+ sync.RWMutex模式?

How can I generalize this map access/modification pattern, considering there aren't generics in go?

func (pool *fPool) fetch(url string) *ResultPromise {
    pool.cacheLock.RLock()
    if rp, pres := pool.cache[url]; pres {
        pool.cacheLock.RUnlock()
        return rp
    }
    pool.cacheLock.RUnlock()
    pool.cacheLock.Lock()
    if rp, pres := pool.cache[url]; pres {
        pool.cacheLock.Unlock()
        // Skip adding url if someone snuck it in between RUnlock an Lock
        return rp
    }
    rp := newPromise()
    pool.cache[url] = rp
    pool.cacheLock.Unlock()
    pool.c <- fetchWork{rp, url} // Expensive/atomic work
    return rp
}

It's used for multiple maps of different types, for obvious reasons.

Maybe it's a poor solution?

Disclaimer: it's the same code from How to test unlikely concurrent scenarios?, sorry.