Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个问题对社区来说并不有趣。
是数据竞赛吗?
是的。您loop1和loop2不会相互竞争,但它们都会与您的for { fmt.Println() }循环竞争,因为fmt.Println同时读取其他函数正在写入相同的值。
loop1
loop2
for { fmt.Println() }
fmt.Println