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