summaryrefslogtreecommitdiff
path: root/internal/hexaicli/testhelpers_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-11-02 23:42:15 +0200
committerPaul Buetow <paul@buetow.org>2025-11-02 23:42:15 +0200
commit35e1de6f975088ade5dbf0af533fe6fdac8fcc94 (patch)
treec9fc9b6ad86cc10a777b3f510c3c4b2d62c41ebd /internal/hexaicli/testhelpers_test.go
parentc60d5703d25b7d76d1da2f368b0632f08a161644 (diff)
some linter fixes
Diffstat (limited to 'internal/hexaicli/testhelpers_test.go')
-rw-r--r--internal/hexaicli/testhelpers_test.go10
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)