Update go version to 1.19 (#829)

* ci: Update go version to 1.19

Signed-off-by: Nicol Draghici <idraghic@cisco.com>

* ci: Fix lint issues

Signed-off-by: Nicol Draghici <idraghic@cisco.com>

* ci: Added needprivileges to lint, made needprivileges pass lint

Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com>
Signed-off-by: Nicol Draghici <idraghic@cisco.com>

Signed-off-by: Nicol Draghici <idraghic@cisco.com>
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com>
Co-authored-by: Catalin Hofnar <catalin.hofnar@gmail.com>
This commit is contained in:
Nicol
2022-10-05 13:21:14 +03:00
committed by GitHub
parent 50aacb6e07
commit 33a431ef43
86 changed files with 294 additions and 274 deletions
+2 -2
View File
@@ -901,7 +901,7 @@ func getRandomSize(probabilityRange []float64) (int, int) {
return size, idx
}
// nolint:gosec
//nolint:gosec
func flipFunc(probabilityRange []float64) int {
mrand.Seed(time.Now().UTC().UnixNano())
toss := mrand.Float64()
@@ -935,7 +935,7 @@ func normalizeProbabilityRange(pbty []float64) []float64 {
return npd
}
func loadOrStore(statusRequests *sync.Map, key string, value int) int {
func loadOrStore(statusRequests *sync.Map, key string, value int) int { //nolint:unparam
val, _ := statusRequests.LoadOrStore(key, value)
intValue, ok := val.(int)
+1 -1
View File
@@ -1,4 +1,4 @@
package main // nolint:testpackage // separate binary
package main //nolint:testpackage // separate binary
import (
"testing"
+9 -9
View File
@@ -42,10 +42,10 @@ const (
TLSHandshakeTimeout = 10 * time.Second
)
// nolint:gochecknoglobals
//nolint:gochecknoglobals
var blobHash map[string]godigest.Digest = map[string]godigest.Digest{}
// nolint:gochecknoglobals // used only in this test
//nolint:gochecknoglobals // used only in this test
var statusRequests sync.Map
func setup(workingDir string) {
@@ -99,7 +99,7 @@ func setup(workingDir string) {
digest, err := godigest.FromReader(fhandle)
if err != nil {
log.Fatal(err) // nolint:gocritic // file closed on exit
log.Fatal(err) //nolint:gocritic // file closed on exit
}
blobHash[fname] = digest
@@ -200,7 +200,7 @@ type manifestStruct struct {
manifestBySizeHash map[int](map[string]string)
}
// nolint:gochecknoglobals // used only in this test
//nolint:gochecknoglobals // used only in this test
var cicdSummary = []cicdTestSummary{}
func printStats(requests int, summary *statsSummary, outFmt string) {
@@ -271,7 +271,7 @@ type testFunc func(
client *resty.Client,
) error
// nolint:gosec
//nolint:gosec
func GetCatalog(
workdir, url, repo string,
requests int,
@@ -444,7 +444,7 @@ func Pull(
config.size = largeBlob
// Push large blob
// nolint: ineffassign, staticcheck, wastedassign
//nolint: ineffassign, staticcheck, wastedassign
manifestBySize, repos, err = pushMonolithImage(workdir, url, trepo, repos, config, client)
if err != nil {
return err
@@ -537,7 +537,7 @@ type testConfig struct {
mixedSize, mixedType bool
}
var testSuite = []testConfig{ // nolint:gochecknoglobals // used only in this test
var testSuite = []testConfig{ //nolint:gochecknoglobals // used only in this test
{
name: "Get Catalog",
tfunc: GetCatalog,
@@ -777,7 +777,7 @@ func getRandomClientIPs(auth string, url string, ips []string) (*resty.Client, e
log.Fatal(err)
}
// nolint: gosec
//nolint: gosec
if parsedURL.Scheme == secureProtocol {
client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})
}
@@ -787,7 +787,7 @@ func getRandomClientIPs(auth string, url string, ips []string) (*resty.Client, e
// getIPsFromCIDR returns a list of ips given a cidr.
func getIPsFromCIDR(cidr string, maxIPs int) ([]string, error) {
// nolint:varnamelen
//nolint:varnamelen
ip, ipnet, err := net.ParseCIDR(cidr)
if err != nil {
return nil, err