June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package atomic import ( "errors" "sync" ) // SafeMap uses a mutex to allow // getting and setting in a thread-safe way type SafeMap struct { m map[string]string mu *sync.RWMutex } // NewSafeMap creates a SafeMap func NewSafeMap() SafeMap { return SafeMap{m: make(map[string]string), mu: &sync.RWMutex{}} } // Set uses a write lock and sets the value given // a key func (t *SafeMap) ...Read now
Unlock full access