March 2019
Intermediate to advanced
336 pages
9h 9m
English
The NewCache method returns a pointer to a cache, which is initialized with the nil map (that is, a map without values) and RWMutex. This is shown in the following code:
//NewCache methodfunc NewCache() *Cache { return &Cache{ objects: make(map[string]CacheObject), mutex: &sync.RWMutex{}, }}
Read now
Unlock full access