diff options
| author | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:35:21 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:35:21 +0200 |
| commit | 9c4985368aee638d982f30ea7bc5c7ee71ae3ab3 (patch) | |
| tree | 10b0bd88547c366b05404419b9e7dee1b1a1e270 /internal/config/atomicfile | |
| parent | cd4e5a23852ca5f9af7f66f1daa9dfbf7d8e7376 (diff) | |
All: Fix staticcheck errors
Diffstat (limited to 'internal/config/atomicfile')
| -rw-r--r-- | internal/config/atomicfile/atomicfile.go | 4 | ||||
| -rw-r--r-- | internal/config/atomicfile/atomicfile_test.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/config/atomicfile/atomicfile.go b/internal/config/atomicfile/atomicfile.go index 5c18e85..542f58a 100644 --- a/internal/config/atomicfile/atomicfile.go +++ b/internal/config/atomicfile/atomicfile.go @@ -29,8 +29,8 @@ func WriteFile(filename string, data []byte, perm os.FileMode) (err error) { tmpName := f.Name() defer func() { if err != nil { - f.Close() - os.Remove(tmpName) + f.Close() //nolint:errcheck + os.Remove(tmpName) //nolint:errcheck } }() if _, err := f.Write(data); err != nil { diff --git a/internal/config/atomicfile/atomicfile_test.go b/internal/config/atomicfile/atomicfile_test.go index 670d225..f14cb31 100644 --- a/internal/config/atomicfile/atomicfile_test.go +++ b/internal/config/atomicfile/atomicfile_test.go @@ -24,7 +24,7 @@ func TestDoesNotOverwriteIrregularFiles(t *testing.T) { // macOS private temp does not allow unix socket creation, but /tmp does. if runtime.GOOS == "darwin" { path = filepath.Join("/tmp", filename) - t.Cleanup(func() { os.Remove(path) }) + t.Cleanup(func() { os.Remove(path) }) //nolint:errcheck } else { path = filepath.Join(t.TempDir(), filename) } @@ -35,7 +35,7 @@ func TestDoesNotOverwriteIrregularFiles(t *testing.T) { if err != nil { t.Fatal(err) } - defer l.Close() + defer l.Close() //nolint:errcheck err = WriteFile(path, []byte("hello"), 0o644) if err == nil { |
