在 go 官方文档中看到的一句话
原地址 : https://golang.org/ref/mem
在其中的 advice 中 :
If you must read the rest of this document to understand the behavior of your program, you are being too clever. Don't be clever.
这个是啥意思呢?
原地址 : https://golang.org/ref/mem
在其中的 advice 中 :
If you must read the rest of this document to understand the behavior of your program, you are being too clever. Don't be clever.
这个是啥意思呢?
It’s not a good thing to be too clever.
不过似乎语境不一样, 帮顶
2. 作者不太建议一定要看完所有, 类似于 “好读书不求甚解”, 理解为重, 不要全部看完
就是建议不要太死板, 自作聪明
3. 就是 @ClericPy 说的, 新手老老实实就行
Advice
Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access.
To serialize access, protect the data with channel operations or other synchronization primitives such as those in the sync and sync/atomic packages.
If you must read the rest of this document to understand the behavior of your program, you are being too clever.
Don’t be clever.
忠告
修改由多个 goroutine 同时访问的数据的程序必须序列化此类访问。
要序列化访问,请使用通道操作或其他同步原语(例如 sync 和 sync / atomic 包中的原语)保护数据。
如果您必须阅读本文档的其余部分以了解程序的行为,那么您就太聪明了。
别聪明