package main
import (
amp;quot;fmtamp;quot;
)
type A struct {
Text string
Name string
}
func (a *A) Say() {
fmt.Printf(amp;quot;A::Say():%s\namp;quot;, a.Text)
}
type B struct {
...……
下一步应该是互斥锁了。
package main
import (
amp;quot;fmtamp;quot;
amp;quot;runtimeamp;quot;
amp;quot;syncamp;quot;
amp;quot;sync/atomicamp;quot;
)
var (
counter int64
wg sync.WaitGroup
)
fu ...……
维基百科对「坑」的定义(原文中叫 Gotcha):
a gotcha is a valid construct in a system, program or programming language that works as documented but is counter-intuitive and almost invites mistakes b ...……