Skip to content

Commit

Permalink
addressing revive hints
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarazzutti committed Aug 21, 2023
1 parent 0c8492d commit 9ef0f6d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0

// Package app provides the main logic for the app
package app

import (
Expand Down
2 changes: 1 addition & 1 deletion app/pinger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (webClientBuilderMock *webClientBuilderMock) URL() string {
return "https://www.google.com"
}

func (webClientBuilderMock *webClientBuilderMock) SetURL(url *url.URL) {
func (webClientBuilderMock *webClientBuilderMock) SetURL(*url.URL) {
// not needed
}

Expand Down
2 changes: 1 addition & 1 deletion app/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func resolveWithSpecificServer(network, server string, host string) ([]*net.IP,
} else if network == "ip6" {
return resolveWithSpecificServerQtype(dns.TypeAAAA, server, host)
} else {
var ipv4Address []*net.IP = nil
var ipv4Address []*net.IP

answersChan := make(chan *resolveAnswer)

Expand Down
16 changes: 7 additions & 9 deletions app/webclientimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func newHTTP2RoundTripper(config *Config, runtimeConfig *RuntimeConfig, w *webCl
return sockettrace.NewSocketTrace(ctx, dialer, network, ipaddr)
}

var tlsNextProto map[string]func(string, *tls.Conn) http.RoundTripper = nil
var tlsNextProto map[string]func(string, *tls.Conn) http.RoundTripper

if webClient.config.HTTP1 {
tlsNextProto = make(map[string]func(string, *tls.Conn) http.RoundTripper)
Expand Down Expand Up @@ -345,21 +345,19 @@ func extractTLSVersion(res *http.Response) string {
code := int(res.TLS.Version) - 0x0301
if code >= 0 {
return fmt.Sprintf("TLS-1.%d", code)
} else {
return "SSL-3"
}
} else {
return "N/A"
return "SSL-3"

}
return "N/A"

}

func (webClient *webClientImpl) moveToHTTP3(altSvcH3 string, timerRegistry *stats.TimerRegistry, followRedirect bool) *HTTPMeasure {

if altSvcH3 == ":443" {
// nothing
} else if strings.HasPrefix(altSvcH3, ":") {
if strings.HasPrefix(altSvcH3, ":") {
webClient.url.Host = webClient.url.Host + altSvcH3
} else {
} else if altSvcH3 != ":443" {
webClient.url.Host = altSvcH3
}

Expand Down
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0

// Package cmd provides parsing of command-line parameters
package cmd

import (
Expand Down
1 change: 1 addition & 0 deletions net/sockettrace/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0

// Package sockettrace provides tracing mechanisms
package sockettrace

import (
Expand Down
1 change: 1 addition & 0 deletions stats/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0

// Package stats provides simple and basic functions for statistics
package stats

import "math"
Expand Down

0 comments on commit 9ef0f6d

Please sign in to comment.