diff --git a/go.mod b/go.mod index 401d781a..f2e176ce 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/huntresslabs/go-systemd -go 1.23 +go 1.20 require github.com/godbus/dbus/v5 v5.1.0 diff --git a/import1/dbus_test.go b/import1/dbus_test.go index 800c6ae3..998751cb 100644 --- a/import1/dbus_test.go +++ b/import1/dbus_test.go @@ -36,7 +36,7 @@ func cleanupImport(t *testing.T, name string) { err error dur = 500 * time.Millisecond ) - for range 5 { + for i := 0; i < 5; i++ { time.Sleep(dur) out, err = exec.Command("machinectl", "remove", name).CombinedOutput() if err == nil { diff --git a/internal/dlopen/dlopen_test.go b/internal/dlopen/dlopen_test.go index 60fbb57e..eede677c 100644 --- a/internal/dlopen/dlopen_test.go +++ b/internal/dlopen/dlopen_test.go @@ -88,7 +88,7 @@ func TestDlopenThreadSafety(t *testing.T) { wg := sync.WaitGroup{} wg.Add(count) - for range count { + for i := 0; i < count; i++ { go func() { defer wg.Done() lib, err := GetHandle(libs) diff --git a/sdjournal/journal_test.go b/sdjournal/journal_test.go index 231d7780..13767f03 100755 --- a/sdjournal/journal_test.go +++ b/sdjournal/journal_test.go @@ -406,7 +406,7 @@ func TestJournalGetCatalog(t *testing.T) { // Look for an entry with MESSAGE_ID (required for GetCatalog). found := false - for range 100 { + for i := 0; i < 100; i++ { n, err := j.Next() if err != nil { t.Fatalf("Error reading journal: %s", err) diff --git a/unit/option.go b/unit/option.go index 800ecda4..98e1af5c 100644 --- a/unit/option.go +++ b/unit/option.go @@ -49,7 +49,7 @@ func AllMatch(u1 []*UnitOption, u2 []*UnitOption) bool { return false } - for i := range length { + for i := 0; i < length; i++ { if !u1[i].Match(u2[i]) { return false }