Fix golint failures in client-go/transport

Signed-off-by: Wilson Husin <whusin@vmware.com>

Kubernetes-commit: 889ffb04d03e49cdbb481b86ea233d0aa3143db6
This commit is contained in:
Wilson Husin 2020-10-15 11:06:24 -07:00 committed by Kubernetes Publisher
parent 30548acd0a
commit d6281e9d1e
2 changed files with 3 additions and 2 deletions

View File

@ -108,7 +108,7 @@ func (c *Config) HasCertAuth() bool {
return (len(c.TLS.CertData) != 0 || len(c.TLS.CertFile) != 0) && (len(c.TLS.KeyData) != 0 || len(c.TLS.KeyFile) != 0)
}
// HasCertCallbacks returns whether the configuration has certificate callback or not.
// HasCertCallback returns whether the configuration has certificate callback or not.
func (c *Config) HasCertCallback() bool {
return c.TLS.GetCert != nil
}

View File

@ -146,6 +146,7 @@ type userAgentRoundTripper struct {
rt http.RoundTripper
}
// NewUserAgentRoundTripper will add User-Agent header to a request unless it has already been set.
func NewUserAgentRoundTripper(agent string, rt http.RoundTripper) http.RoundTripper {
return &userAgentRoundTripper{agent, rt}
}
@ -260,7 +261,7 @@ func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTr
return &bearerAuthRoundTripper{bearer, nil, rt}
}
// NewBearerAuthRoundTripper adds the provided bearer token to a request
// NewBearerAuthWithRefreshRoundTripper adds the provided bearer token to a request
// unless the authorization header has already been set.
// If tokenFile is non-empty, it is periodically read,
// and the last successfully read content is used as the bearer token.