草庐IT

ValidateCredentialsResponse

全部标签

Golang 多个 goroutine 通过引用共享同一个变量

我正在尝试运行多个goroutine来修改通过引用传递的相同变量。但我确信我实现它的方式在功能上是不正确的。尽管它似乎在我的测试中有效,但我感觉如果第二个goroutine比第一个goroutine花费更长的时间运行,那么当第一个goroutine完成时,这种模式会结束父函数。我希望得到您的意见/建议/忠告。packageauthimport("regexp"zxcvbn"github.com/nbutton23/zxcvbn-go""golang.org/x/net/context")typeAuthServicestruct{}funcNewAuthService()*AuthSe