lint: Clean up golangci-lint v1.60 complaints

This cleans up the linting results by adding checks for
integer underflow/overflow in several places, suppressing the error in
places where it has been checked, or fixing the types when possible.
This commit is contained in:
Brian C. Lane 2025-02-13 16:49:40 -08:00 committed by Brian C. Lane
parent 2dad1a965e
commit 0256e09031
11 changed files with 47 additions and 12 deletions

View file

@ -574,7 +574,7 @@ func GSSAPICredentialsFromEnv() (*GSSAPICredentials, error) {
}, nil
}
func CreateKojiTransport(relaxTimeout uint) http.RoundTripper {
func CreateKojiTransport(relaxTimeout time.Duration) http.RoundTripper {
// Koji for some reason needs TLS renegotiation enabled.
// Clone the default http rt and enable renegotiation.
rt := CreateRetryableTransport()
@ -588,9 +588,9 @@ func CreateKojiTransport(relaxTimeout uint) http.RoundTripper {
// Relax timeouts a bit
if relaxTimeout > 0 {
transport.TLSHandshakeTimeout *= time.Duration(relaxTimeout)
transport.TLSHandshakeTimeout *= relaxTimeout
transport.DialContext = (&net.Dialer{
Timeout: 30 * time.Second * time.Duration(relaxTimeout),
Timeout: 30 * time.Second * relaxTimeout,
KeepAlive: 30 * time.Second,
}).DialContext
}