diff options
| author | Paul Buetow <paul@buetow.org> | 2025-11-02 23:42:15 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-11-02 23:42:15 +0200 |
| commit | 35e1de6f975088ade5dbf0af533fe6fdac8fcc94 (patch) | |
| tree | c9fc9b6ad86cc10a777b3f510c3c4b2d62c41ebd /internal/hexaicli/testhelpers_test.go | |
| parent | c60d5703d25b7d76d1da2f368b0632f08a161644 (diff) | |
some linter fixes
Diffstat (limited to 'internal/hexaicli/testhelpers_test.go')
| -rw-r--r-- | internal/hexaicli/testhelpers_test.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/hexaicli/testhelpers_test.go b/internal/hexaicli/testhelpers_test.go index 4cc04f7..16f1639 100644 --- a/internal/hexaicli/testhelpers_test.go +++ b/internal/hexaicli/testhelpers_test.go @@ -25,7 +25,9 @@ func setStdin(t *testing.T, content string) (func(), *os.File) { old := os.Stdin os.Stdin = f restore := func() { - f.Close() + if err := f.Close(); err != nil { + t.Errorf("failed to close temp stdin file: %v", err) + } os.Stdin = old } return restore, f @@ -71,7 +73,11 @@ func writeTOML(t *testing.T, path string, m map[string]string) { if err != nil { t.Fatalf("create: %v", err) } - defer f.Close() + defer func() { + if err := f.Close(); err != nil { + t.Errorf("failed to close temp TOML file: %v", err) + } + }() for k, v := range m { if _, err := f.WriteString(k + " = \"" + v + "\"\n"); err != nil { t.Fatalf("write: %v", err) |
