Skip to content

Commit 51a9124

Browse files
committed
go fix
1 parent d165f2f commit 51a9124

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

runner/bubblewrap_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func ensureSandboxParentDirs(args *[]string, seen map[string]struct{}, path stri
280280
}
281281

282282
current := "/"
283-
for _, part := range strings.Split(strings.TrimPrefix(parent, "/"), "/") {
283+
for part := range strings.SplitSeq(strings.TrimPrefix(parent, "/"), "/") {
284284
if part == "" {
285285
continue
286286
}
@@ -294,13 +294,13 @@ func ensureSandboxParentDirs(args *[]string, seen map[string]struct{}, path stri
294294
}
295295

296296
func parseDbusSocketPath(address string) string {
297-
for _, candidate := range strings.Split(address, ";") {
297+
for candidate := range strings.SplitSeq(address, ";") {
298298
candidate = strings.TrimSpace(candidate)
299299
if !strings.HasPrefix(candidate, "unix:") {
300300
continue
301301
}
302302

303-
for _, param := range strings.Split(strings.TrimPrefix(candidate, "unix:"), ",") {
303+
for param := range strings.SplitSeq(strings.TrimPrefix(candidate, "unix:"), ",") {
304304
key, value, ok := strings.Cut(strings.TrimSpace(param), "=")
305305
if !ok {
306306
continue

runner/bubblewrap_linux_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ func TestParseDbusSocketPath(t *testing.T) {
103103
}
104104

105105
for _, tc := range tests {
106-
tc := tc
107106
t.Run(tc.name, func(t *testing.T) {
108107
t.Parallel()
109108
assert.Equal(t, tc.want, parseDbusSocketPath(tc.address))

runner/firejail_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func newFirejailTestRunner(t *testing.T, noNetwork bool) *firejailRunner {
4545

4646
func parseEnvironmentOutput(output string) map[string]string {
4747
out := make(map[string]string)
48-
for _, line := range strings.Split(strings.TrimSpace(output), "\n") {
48+
for line := range strings.SplitSeq(strings.TrimSpace(output), "\n") {
4949
if line == "" {
5050
continue
5151
}

0 commit comments

Comments
 (0)