Skip to content

Commit dfd947b

Browse files
authored
Update go version to 1.23 and removed some helper methods in favor of STD library (#5200)
* update go version * fix go vet errors * replaces stringutils with slices std package * added slices package * 1.22.4 to 1.23.4 --------- Co-authored-by: Valentin <[email protected]>
1 parent e927605 commit dfd947b

File tree

37 files changed

+89
-140
lines changed

37 files changed

+89
-140
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ indent_style = none
2424
indent_size = none
2525
[{go.mod,go.sum,*.go,*.golden}]
2626
indent_style = tab
27-
indent_size = 8

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- uses: actions/setup-go@v5
2525
with:
26-
go-version: '1.22.4'
26+
go-version: '1.23.4'
2727

2828
- name: Install Groovy
2929
run: sudo apt-get update && sudo apt-get install groovy -y

.github/workflows/update-go-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-go@v5
1515
with:
16-
go-version: '1.22.4'
16+
go-version: '1.23.4'
1717
- name: Perform update
1818
run: |
1919
git checkout -B gh-action-update-golang-dependencies

.github/workflows/upload-go-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-go@v5
1515
with:
16-
go-version: '1.22.4'
16+
go-version: '1.23.4'
1717
- env:
1818
CGO_ENABLED: 0
1919
run: |

.github/workflows/verify-go.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: styfle/[email protected]
1616
- uses: actions/setup-go@v5
1717
with:
18-
go-version: '1.22.4'
18+
go-version: '1.23.4'
1919
- name: Cache Golang Packages
2020
uses: actions/cache@v3
2121
with:
@@ -43,7 +43,7 @@ jobs:
4343
steps:
4444
- uses: actions/setup-go@v5
4545
with:
46-
go-version: '1.22.4'
46+
go-version: '1.23.4'
4747
- name: Cache Golang Packages
4848
uses: actions/cache@v3
4949
with:
@@ -63,7 +63,7 @@ jobs:
6363
steps:
6464
- uses: actions/setup-go@v5
6565
with:
66-
go-version: '1.22.4'
66+
go-version: '1.23.4'
6767
- name: checkout
6868
uses: actions/checkout@v4
6969
with:
@@ -78,7 +78,7 @@ jobs:
7878
steps:
7979
- uses: actions/setup-go@v5
8080
with:
81-
go-version: '1.22.4'
81+
go-version: '1.23.4'
8282
- name: Cache Golang Packages
8383
uses: actions/cache@v3
8484
with:
@@ -98,7 +98,7 @@ jobs:
9898
steps:
9999
- uses: actions/setup-go@v5
100100
with:
101-
go-version: '1.22.4'
101+
go-version: '1.23.4'
102102
- name: Cache Golang Packages
103103
uses: actions/cache@v3
104104
with:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.4 AS build-env
1+
FROM golang:1.23.4 AS build-env
22
COPY . /build
33
WORKDIR /build
44

cmd/cloudFoundryDeploy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io"
77
"os"
88
"regexp"
9+
"slices"
910
"sort"
1011
"strings"
1112
"time"
@@ -414,7 +415,7 @@ func deployMta(config *cloudFoundryDeployOptions, mtarFilePath string, command c
414415
deployCommand = "bg-deploy"
415416

416417
const noConfirmFlag = "--no-confirm"
417-
if !piperutils.ContainsString(deployParams, noConfirmFlag) {
418+
if !slices.Contains(deployParams, noConfirmFlag) {
418419
deployParams = append(deployParams, noConfirmFlag)
419420
}
420421
}

cmd/cnbBuild.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path"
88
"path/filepath"
9+
"slices"
910

1011
"github.com/SAP/jenkins-library/pkg/buildpacks"
1112
"github.com/SAP/jenkins-library/pkg/buildsettings"
@@ -594,7 +595,7 @@ func runCnbBuild(config *cnbBuildOptions, telemetry *buildpacks.Telemetry, image
594595
}
595596
for _, tag := range config.AdditionalTags {
596597
target := fmt.Sprintf("%s:%s", containerImage, tag)
597-
if !piperutils.ContainsString(creatorArgs, target) {
598+
if !slices.Contains(creatorArgs, target) {
598599
creatorArgs = append(creatorArgs, "-tag", target)
599600
}
600601
}

cmd/detectExecuteScan.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io"
88
"net/http"
99
"path/filepath"
10+
"slices"
1011
"sort"
1112
"strconv"
1213
"strings"
@@ -467,7 +468,7 @@ func addDetectArgs(args []string, config detectExecuteScanOptions, utils detectU
467468
handleExcludedDirectories(&args, &config)
468469

469470
if config.Unmap {
470-
if !piperutils.ContainsString(config.ScanProperties, "--detect.project.codelocation.unmap=true") {
471+
if !slices.Contains(config.ScanProperties, "--detect.project.codelocation.unmap=true") {
471472
args = append(args, "--detect.project.codelocation.unmap=true")
472473
}
473474
config.ScanProperties, _ = piperutils.RemoveAll(config.ScanProperties, "--detect.project.codelocation.unmap=false")

cmd/fortifyExecuteScan.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"path/filepath"
1212
"regexp"
1313
"runtime"
14+
"slices"
1415
"strconv"
1516
"strings"
1617
"time"
@@ -211,7 +212,7 @@ func runFortifyScan(ctx context.Context, config fortifyExecuteScanOptions, sys f
211212
prID, prAuthor := determinePullRequestMerge(config)
212213
if prID != "0" {
213214
log.Entry().Debugf("Determined PR ID '%v' for merge check", prID)
214-
if len(prAuthor) > 0 && !piperutils.ContainsString(config.Assignees, prAuthor) {
215+
if len(prAuthor) > 0 && !slices.Contains(config.Assignees, prAuthor) {
215216
log.Entry().Debugf("Determined PR Author '%v' for result assignment", prAuthor)
216217
config.Assignees = append(config.Assignees, prAuthor)
217218
} else {

0 commit comments

Comments
 (0)