Skip to content

Commit

Permalink
chore(deps): upgrade to go1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Gelloz authored and Thibaut-gauvin committed Apr 18, 2024
1 parent de499b6 commit 47d2c5e
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 45 deletions.
22 changes: 11 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ run:
linters:
enable-all: true
disable:
- maligned # Disable because they are deprecated and throw warning in logs
- interfacer # Disable because they are deprecated and throw warning in logs
- scopelint # Disable because they are deprecated and throw warning in logs
- golint # Disable because they are deprecated and throw warning in logs
- exhaustivestruct # Disable because they are deprecated and throw warning in logs
- ifshort # Disable because they are deprecated and throw warning in logs
- deadcode # Disable because they are deprecated and throw warning in logs
- varcheck # Disable because they are deprecated and throw warning in logs
- structcheck # Disable because they are deprecated and throw warning in logs
- nosnakecase # Disable because they are deprecated and throw warning in logs
- cyclop # calculates cyclomatic complexities of functions or packages => legit, but we prefer to use sonarqube and be non-blocking
- depguard # We do not have particular restrictions on which packages should be allowed or not
- exhaustruct # Find structs that have uninitialized fields. => We want to rely on default field initialization
Expand All @@ -23,16 +33,6 @@ linters:
- wsl # Whitespace Linter - Forces you to use empty lines! => We don't care
- wrapcheck # A Go linter to check that errors from external packages are wrapped => A bit too annoying
- exhaustive # We don't want to force struct exhaustive
- maligned # Disable because they are deprecated and throw warning in logs
- interfacer # Disable because they are deprecated and throw warning in logs
- scopelint # Disable because they are deprecated and throw warning in logs
- golint # Disable because they are deprecated and throw warning in logs
- exhaustivestruct # Disable because they are deprecated and throw warning in logs
- ifshort # Disable because they are deprecated and throw warning in logs
- dupl # Disable because they are deprecated and throw warning in logs
- deadcode # Disable because they are deprecated and throw warning in logs
- varcheck # Disable because they are deprecated and throw warning in logs
- structcheck # Disable because they are deprecated and throw warning in logs
- nosnakecase # Disable because they are deprecated and throw warning in logs
- musttag # Enforce field tags in (un)marshaled structs => Too many false positive errors, and lint code out of project scope
- perfsprint # Performance is not an issue
- dupl # Duplicate code necessary in tests
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/radiofrance/dib

go 1.21
go 1.22

toolchain go1.21.0
toolchain go1.22.2

require (
github.com/aws/aws-sdk-go-v2 v1.26.1
Expand Down
1 change: 0 additions & 1 deletion pkg/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (d *DAG) WalkAsyncErr(visitor NodeVisitorFuncErr) error {
uniqueVisitor := createUniqueVisitorErr(visitor)
errG := new(errgroup.Group)
for _, node := range d.nodes {
node := node
errG.Go(func() error {
return node.walkAsyncErr(uniqueVisitor)
})
Expand Down
1 change: 0 additions & 1 deletion pkg/dag/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func (n *Node) walkAsyncErr(visitor NodeVisitorFuncErr) error {
return visitor(n)
})
for _, childNode := range n.children {
childNode := childNode
errG.Go(func() error {
return childNode.walkAsyncErr(visitor)
})
Expand Down
1 change: 0 additions & 1 deletion pkg/dib/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ func TestRebuildGraph(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions pkg/dib/generate_dag_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ func Test_loadCustomHumanizedHashList(t *testing.T) {
}

for _, test := range testCases {
test := test

t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 0 additions & 4 deletions pkg/dib/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ func Test_GenerateList_GoTemplateFile(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -151,8 +149,6 @@ func Test_ParseOutputOptions(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion pkg/dib/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ func testImage(testRunners []types.TestRunner, runTestOpts types.RunTestOptions)
logger.Infof("Running tests for \"%s\"", runTestOpts.ImageReference)
errG := new(errgroup.Group)
for _, runner := range testRunners {
runner := runner
errG.Go(func() error {
if !runner.IsConfigured(runTestOpts) {
return nil
Expand Down
1 change: 0 additions & 1 deletion pkg/dockerfile/dockerfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ func TestParseDockerfile(t *testing.T) {
},
}
for name, test := range tests {
test := test
t.Run(name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions pkg/junit/xml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ func Test_ParseRawLogs(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion pkg/kaniko/executor_kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func Test_KubernetesExecutor_Execute(t *testing.T) {
{"build failed", false},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
clientSet := fake.NewSimpleClientset()
Expand Down
8 changes: 0 additions & 8 deletions pkg/report/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestReport_GetRootDir(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
dibReport := report.Report{
Expand Down Expand Up @@ -79,7 +78,6 @@ func TestReport_GetBuildLogDir(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
dibReport := report.Report{
Expand Down Expand Up @@ -115,8 +113,6 @@ func TestReport_GetJunitReportDir(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.name, func(t *testing.T) {
t.Parallel()
dibReport := report.Report{
Expand Down Expand Up @@ -152,8 +148,6 @@ func TestReport_GetTrivyReportDir(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.name, func(t *testing.T) {
t.Parallel()
dibReport := report.Report{
Expand Down Expand Up @@ -236,8 +230,6 @@ func TestReport_CheckError(t *testing.T) {
}

for _, test := range tests {
test := test

t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 0 additions & 2 deletions pkg/report/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func TestReport_Init(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -165,7 +164,6 @@ func TestGenerate(t *testing.T) {
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
5 changes: 0 additions & 5 deletions pkg/report/utils_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func TestReport_isTestRunnerEnabled(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
actual := isTestRunnerEnabled(test.input.name, test.input.testRunners)
Expand Down Expand Up @@ -103,7 +102,6 @@ func TestReport_sortBuildReport(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
actual := sortBuildReport(test.input)
Expand Down Expand Up @@ -184,7 +182,6 @@ func TestReport_sortTrivyScan(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
actual := sortTrivyScan(test.input)
Expand Down Expand Up @@ -224,7 +221,6 @@ func TestReport_beautifyBuildsLogs(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
actual := beautifyBuildsLogs([]byte(test.input))
Expand Down Expand Up @@ -259,7 +255,6 @@ func TestReport_sanitize(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
actual := sanitize(test.input)
Expand Down
2 changes: 0 additions & 2 deletions pkg/report/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func TestReport_RemoveTerminalColors(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
actual := report.RemoveTerminalColors([]byte(test.input))
Expand Down Expand Up @@ -70,7 +69,6 @@ func TestReport_StripKanikoBuildLogs(t *testing.T) {
}

for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion pkg/trivy/executor_kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func Test_KubernetesExecutor_Execute(t *testing.T) {
{"build failed", false},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
clientSet := fake.NewSimpleClientset()
Expand Down

0 comments on commit 47d2c5e

Please sign in to comment.