June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package bench import "sync" // Counter uses a sync.RWMutex to safely // modify a value type Counter struct { value int64 mu *sync.RWMutex } // Add increments the counter func (c *Counter) Add(amount int64) { c.mu.Lock() c.value += amount c.mu.Unlock() } // Read returns the current counter amountRead now
Unlock full access