From d6281e9d1e7b9cf9d68571ec6718a3539155f9e6 Mon Sep 17 00:00:00 2001 From: Wilson Husin Date: Thu, 15 Oct 2020 11:06:24 -0700 Subject: [PATCH] Fix golint failures in client-go/transport Signed-off-by: Wilson Husin Kubernetes-commit: 889ffb04d03e49cdbb481b86ea233d0aa3143db6 --- transport/config.go | 2 +- transport/round_trippers.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/transport/config.go b/transport/config.go index 0c9ccce27..070474831 100644 --- a/transport/config.go +++ b/transport/config.go @@ -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 } diff --git a/transport/round_trippers.go b/transport/round_trippers.go index b198e5dbb..056bc023c 100644 --- a/transport/round_trippers.go +++ b/transport/round_trippers.go @@ -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.