func getTimeout(ctx context.Context) time.Duration {
	deadline, ok := ctx.Deadline()
	if !ok {
		return DefaultConnectTimeout
	}

	return deadline.Sub(time.Now())
}
func getTimeout(ctx context.Context) time.Duration {
	deadline, ok := ctx.Deadline()
	if !ok {
		return DefaultConnectTimeout
	}

	return deadline.Sub(time.Now())
}
func getTimeout ( ctx context . Context ) time . Duration { deadline , ok := ctx . Deadline ( ) if ! ok { return DefaultConnectTimeout } return deadline . Sub ( time . Now ( ) ) }
//go:generate stringer -type=connectionState
go : generate stringer - type = connectionState