Go is generally known for having good built-in support for concurrency in Go. The solution was fixed in #2171 by using sync. It could also have been fixed without using the sync package by using an init function to set the variable v once. When the doSomething function is evaluated, running RLock / RUnlock will not affect the

6m read timeFrom blog.devgenius.io
Post cover image
Table of contents
Concurrency in Go is hardUsing global variablesCopying structs from the sync packageUsing time.AfterConclusion
1 Comment

Sort: