config/transport.go
func (c *TransportConfig) Finalize() {
	if c.DialKeepAlive == nil {
		c.DialKeepAlive = TimeDuration(DefaultDialKeepAlive)
	}

	if c.DialTimeout == nil {
		c.DialTimeout = TimeDuration(DefaultDialTimeout)
	}

	if c.DisableKeepAlives == nil {
		c.DisableKeepAlives = Bool(false)
	}

	if c.IdleConnTimeout == nil {
		c.IdleConnTimeout = TimeDuration(DefaultIdleConnTimeout)
	}

	if c.MaxIdleConns == nil {
		c.MaxIdleConns = Int(DefaultMaxIdleConns)
	}

	if c.MaxIdleConnsPerHost == nil {
		c.MaxIdleConnsPerHost = Int(DefaultMaxIdleConnsPerHost)
	}

	if c.TLSHandshakeTimeout == nil {
		c.TLSHandshakeTimeout = TimeDuration(DefaultTLSHandshakeTimeout)
	}
}
func (c *TransportConfig) Finalize() {
	if c.DialKeepAlive == nil {
		c.DialKeepAlive = TimeDuration(DefaultDialKeepAlive)
	}

	if c.DialTimeout == nil {
		c.DialTimeout = TimeDuration(DefaultDialTimeout)
	}

	if c.DisableKeepAlives == nil {
		c.DisableKeepAlives = Bool(false)
	}

	if c.IdleConnTimeout == nil {
		c.IdleConnTimeout = TimeDuration(DefaultIdleConnTimeout)
	}

	if c.MaxIdleConns == nil {
		c.MaxIdleConns = Int(DefaultMaxIdleConns)
	}

	if c.MaxIdleConnsPerHost == nil {
		c.MaxIdleConnsPerHost = Int(DefaultMaxIdleConnsPerHost)
	}

	if c.TLSHandshakeTimeout == nil {
		c.TLSHandshakeTimeout = TimeDuration(DefaultTLSHandshakeTimeout)
	}
}
func ( c * TransportConfig ) Finalize ( ) { if c . DialKeepAlive == nil { c . DialKeepAlive = TimeDuration ( DefaultDialKeepAlive ) } if c . DialTimeout == nil { c . DialTimeout = TimeDuration ( DefaultDialTimeout ) } if c . DisableKeepAlives == nil { c . DisableKeepAlives = Bool ( false ) } if c . IdleConnTimeout == nil { c . IdleConnTimeout = TimeDuration ( DefaultIdleConnTimeout ) } if c . MaxIdleConns == nil { c . MaxIdleConns = Int ( DefaultMaxIdleConns ) } if c . MaxIdleConnsPerHost == nil { c . MaxIdleConnsPerHost = Int ( DefaultMaxIdleConnsPerHost ) } if c . TLSHandshakeTimeout == nil { c . TLSHandshakeTimeout = TimeDuration ( DefaultTLSHandshakeTimeout ) } }
// Finalize ensures there no nil pointers.
Finalize ensures there no nil pointers .