jjzjj

go - 当 channel 关闭时,以接收 channel 作为参数的 goroutines 是否停止?

一直在看《用go构建微服务》,书中介绍了apache/go-resiliency/deadline用于处理超时的包。deadline.go//Packagedeadlineimplementsthedeadline(alsoknownas"timeout")resiliencypatternforGo.packagedeadlineimport("errors""time")//ErrTimedOutistheerrorreturnedfromRunwhenthedeadlineexpires.varErrTimedOut=errors.New("timedoutwaitingforf