Skip to content

Commit 5259f8e

Browse files
chore: simplify how result lines are constructed
Co-authored-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com> Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent 6216a2a commit 5259f8e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

dagger/maintenance/updatelibs.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"path"
77
"regexp"
8+
"strings"
89

910
"dagger/maintenance/internal/dagger"
1011
)
@@ -43,13 +44,8 @@ func updateOSLibsOnTarget(
4344

4445
var result string
4546
for _, m := range matches {
46-
if len(m) >= 2 {
47-
line := m[1]
48-
if len(m) >= 3 && m[2] != "" {
49-
line += " " + m[2]
50-
}
51-
result += line + "\n"
52-
}
47+
line := strings.Join(m[1:], " ")
48+
result += strings.TrimSuffix(line, " ") + "\n"
5349
}
5450

5551
if result == "" {

0 commit comments

Comments
 (0)