What happens when reading or writing concurrently without a mutex
问题 In Go, a sync.Mutex or chan is used to prevent concurrent access of shared objects. However, in some cases I am just interested in the latest value of a variable or field of an object. Or I like to write a value and do not care if another go-routine overwrites it later or has just overwritten it before. Update: TLDR; Just don't do this. It is not safe. Read the answers, comments, and linked documents! Here are two variants good and bad of an example program, where both seem to produce