Skip to content

Commit 72d50fe

Browse files
authored
Upgrade go version to 1.23 (#157)
* Upgrade go to 1.23 Signed-off-by: thepetk <[email protected]> * Fix linting tool Signed-off-by: thepetk <[email protected]> * Update gosec Signed-off-by: thepetk <[email protected]> * Update upload-artifact Signed-off-by: thepetk <[email protected]> --------- Signed-off-by: thepetk <[email protected]>
1 parent 12cf9c8 commit 72d50fe

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

.github/workflows/scorecard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
4646
# format to the repository Actions tab.
4747
- name: "Upload artifact"
48-
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
48+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4949
with:
5050
name: SARIF file
5151
path: results.sarif

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ check_registry: ## Run registry checks
2828

2929
.PHONY: gosec_install
3030
gosec_install: ## Install gosec utility
31-
go install github.com/securego/gosec/v2/cmd/gosec@v2.14.0
31+
go install github.com/securego/gosec/v2/cmd/gosec@v2.22.0
3232

3333
.PHONY: gosec
3434
gosec: ## Run go security checks
@@ -40,5 +40,4 @@ lint: ## Run golangci-lint linter tool
4040

4141
.PHONY: lint_install
4242
lint_install: ## Install golangci-lint linter tool
43-
@# TODO(rm3l): recent versions of golangci-lint require Go >= 1.20. Update when we start using Go 1.20+
44-
go install github.com/golangci/golangci-lint/cmd/[email protected]
43+
go install github.com/golangci/golangci-lint/cmd/[email protected]

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/devfile/alizer
22

3-
go 1.21
3+
go 1.23
44

55
require (
66
github.com/go-git/go-git/v5 v5.13.1

test/apis/component_recognizer_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func TestPortDetectionFlaskStringValue(t *testing.T) {
361361
func TestComponentDetectionNoResult(t *testing.T) {
362362
components := getComponentsFromTestProject(t, "simple")
363363
if len(components) > 0 {
364-
t.Errorf("Expected 0 components but found " + strconv.Itoa(len(components)))
364+
t.Errorf("Expected 0 components but found %v", strconv.Itoa(len(components)))
365365
}
366366
}
367367

@@ -395,7 +395,7 @@ func TestComponentDetectionWithGitIgnoreRule(t *testing.T) {
395395
components := getComponentsFromFiles(t, files, settings)
396396

397397
if len(components) != 1 {
398-
t.Errorf("Expected 1 components but found " + strconv.Itoa(len(components)))
398+
t.Errorf("Expected 1 components but found %v", strconv.Itoa(len(components)))
399399
}
400400

401401
//now add a gitIgnore with a rule to exclude the only component found
@@ -413,15 +413,15 @@ func TestComponentDetectionWithGitIgnoreRule(t *testing.T) {
413413
os.Remove(gitIgnorePath)
414414

415415
if len(componentsWithUpdatedGitIgnore) != 0 {
416-
t.Errorf("Expected 0 components but found " + strconv.Itoa(len(componentsWithUpdatedGitIgnore)))
416+
t.Errorf("Expected 0 components but found %v", strconv.Itoa(len(componentsWithUpdatedGitIgnore)))
417417
}
418418
}
419419

420420
func TestComponentDetectionMultiProjects(t *testing.T) {
421421
components := getComponentsFromTestProject(t, "")
422422
nComps := 70
423423
if len(components) != nComps {
424-
t.Errorf("Expected " + strconv.Itoa(nComps) + " components but found " + strconv.Itoa(len(components)))
424+
t.Errorf("Expected %v components but found %v", strconv.Itoa(nComps), strconv.Itoa(len(components)))
425425
}
426426
}
427427

test/apis/language_recognizer_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func isLanguageInProject(t *testing.T, project string, wantedLanguage string, wa
6363
}
6464

6565
if !hasWantedLanguage(languages, wantedLanguage, wantedTools, wantedFrameworks) {
66-
t.Errorf("Project does not use " + wantedLanguage + " language")
66+
t.Errorf("Project does not use %v language", wantedLanguage)
6767
}
6868
}
6969

test/apis/utils.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ func verifyComponents(t *testing.T, components []model.Component, expectedNumber
6161
if hasComponents {
6262
isExpectedComponent := strings.EqualFold(expectedLanguage, components[0].Languages[0].Name)
6363
if !isExpectedComponent {
64-
t.Errorf("Project does not use " + expectedLanguage + " language")
64+
t.Errorf("Project does not use %v language ", expectedLanguage)
6565
}
6666
if expectedProjectName != "" {
6767
isExpectedProjectName := strings.EqualFold(expectedProjectName, components[0].Name)
6868
if !isExpectedProjectName {
69-
t.Errorf("Main component has a different project name. Expected " + expectedProjectName + " but it was " + components[0].Name)
69+
t.Errorf("Main component has a different project name. Expected %v but it was %v", expectedProjectName, components[0].Name)
7070
}
7171
}
7272
} else {
73-
t.Errorf("Expected " + strconv.Itoa(expectedNumber) + " of components but it was " + strconv.Itoa(len(components)))
73+
t.Errorf("Expected %v of components but it was %v", strconv.Itoa(expectedNumber), strconv.Itoa(len(components)))
7474
}
7575
}
7676

@@ -94,7 +94,7 @@ func testPortDetectionInProject(t *testing.T, project string, ports []int) {
9494
}
9595
}
9696
if !found {
97-
t.Errorf("Port " + strconv.Itoa(port) + " have not been detected")
97+
t.Errorf("Port %v have not been detected", strconv.Itoa(port))
9898
}
9999
found = false
100100
}

0 commit comments

Comments
 (0)