From eefc0340db79a593fe66d7f59c79873a865f1d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Thu, 14 Mar 2024 09:45:01 -0700 Subject: [PATCH] fallback to go pre go1.22 syntax --- go.mod | 2 +- pkg/encrypt/encrypt_test.go | 2 +- pkg/tmpfile/tmpfile_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 8021bbf..a35409b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.burning.moe/celediel/agedit -go 1.22.0 +go 1.21.0 require ( filippo.io/age v1.1.1 diff --git a/pkg/encrypt/encrypt_test.go b/pkg/encrypt/encrypt_test.go index e7e53f0..03a7af5 100644 --- a/pkg/encrypt/encrypt_test.go +++ b/pkg/encrypt/encrypt_test.go @@ -75,7 +75,7 @@ func TestEncryptionDecryption(t *testing.T) { // TestNewIdentity creats a new identity, writes it to file, then re-reads it back from the file. func TestNewIdentity(t *testing.T) { - for range 1000 { + for i := 0; i <= 1000; i++ { outfile := generator.GenerateFullPath() identity, err := NewIdentity() diff --git a/pkg/tmpfile/tmpfile_test.go b/pkg/tmpfile/tmpfile_test.go index 126f1ce..21b5f0c 100644 --- a/pkg/tmpfile/tmpfile_test.go +++ b/pkg/tmpfile/tmpfile_test.go @@ -12,7 +12,7 @@ var generator = NewGenerator("test_", ".txt", 18) func TestCanCreateTmpFile(t *testing.T) { b := []byte{104, 101, 108, 108, 111, 32, 116, 104, 101, 114, 101} - for range 1000 { + for i := 0; i <= 1000; i++ { outfile := generator.GenerateFullPath() err := os.WriteFile(outfile, b, fs.FileMode(0600)) if err != nil { @@ -33,7 +33,7 @@ func TestCanCreateTmpFile(t *testing.T) { func TestUniqueTmpFile(t *testing.T) { var generated_names = map[string]string{} - for range 100000 { + for i := 0; i <= 100000; i++ { name := generator.GenerateName() if val, ok := generated_names[name]; ok { t.Fatal("Non unique name", val)