Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
kgaughan and sourcery-ai[bot] authored Jun 9, 2024
1 parent b0b24b0 commit ba2fe6d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/testutils/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,25 @@ func TempFile(content string, f func(*os.File)) {
defer os.Remove(tmpfile.Name())

if _, err = tmpfile.WriteString(content); err != nil {
log.Printf("Error writing to temporary file: %v", err)
panic(err)
}
panic(err)
}

if err = tmpfile.Sync(); err != nil {

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body (typecheck)

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

expected declaration, found 'if' (typecheck)

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body) (typecheck)

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body) (typecheck)

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body (typecheck)

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

expected declaration, found 'if' (typecheck)

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body) (typecheck)

Check failure on line 45 in internal/testutils/testutils.go

View workflow job for this annotation

GitHub Actions / build

syntax error: non-declaration statement outside function body) (typecheck)
log.Printf("Error syncing tmpfile: %v", err)
panic(err)
}
panic(err)
}

f(tmpfile)

if err = tmpfile.Close(); err != nil {
log.Printf("Error closing tmpfile: %v", err)
panic(err)
}
panic(err)
}
}
Expand Down

0 comments on commit ba2fe6d

Please sign in to comment.