March 2019
Intermediate to advanced
336 pages
9h 9m
English
The Reset method of the Dictionary class is presented in the following snippet. The Lock method of the dictionary's lock instance is invoked and Unlock is deferred. The elements map is initialized with a map of the DictKey key and the DictVal value:
// Reset methodfunc (dict *Dictionary) Reset() { dict.lock.Lock() defer dict.lock.Unlock() dict.elements = make(map[DictKey]DictVal)}
Read now
Unlock full access