Fix remaining wsl_v5 whitespace findings (refs #61)
Insert the blank line wsl_v5 requires above `defer` and `go` statements that share no variables with the statement above them. Applied mechanically via `make lint-fix`; the diff is 60 added blank lines and nothing else.
This commit is contained in:
@@ -259,6 +259,7 @@ func (sm *SnapshotManager) ExportSnapshotMetadata(
|
||||
}
|
||||
|
||||
log.Debug("Created temporary directory", "path", tempDir)
|
||||
|
||||
defer func() {
|
||||
log.Debug("Cleaning up temporary directory", "path", tempDir)
|
||||
|
||||
@@ -555,6 +556,7 @@ func (sm *SnapshotManager) cleanSnapshotDB(
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("opening temp database: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
err := db.Close()
|
||||
if err != nil {
|
||||
@@ -567,6 +569,7 @@ func (sm *SnapshotManager) cleanSnapshotDB(
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("beginning transaction: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
rbErr := tx.Rollback()
|
||||
if rbErr != nil && !errors.Is(rbErr, sql.ErrTxDone) {
|
||||
@@ -685,6 +688,7 @@ func (sm *SnapshotManager) compressFile(inputPath, outputPath string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("opening input file: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
err := input.Close()
|
||||
if err != nil {
|
||||
@@ -696,6 +700,7 @@ func (sm *SnapshotManager) compressFile(inputPath, outputPath string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating output file: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
err := output.Close()
|
||||
if err != nil {
|
||||
@@ -714,6 +719,7 @@ func (sm *SnapshotManager) compressFile(inputPath, outputPath string) error {
|
||||
|
||||
// Track if writer has been closed to avoid double-close
|
||||
writerClosed := false
|
||||
|
||||
defer func() {
|
||||
if !writerClosed {
|
||||
err := writer.Close()
|
||||
@@ -749,6 +755,7 @@ func (sm *SnapshotManager) copyFile(src, dst string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
log.Debug("Closing source file", "path", src)
|
||||
|
||||
@@ -764,6 +771,7 @@ func (sm *SnapshotManager) copyFile(src, dst string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
log.Debug("Closing destination file", "path", dst)
|
||||
|
||||
@@ -794,6 +802,7 @@ func (sm *SnapshotManager) generateBlobManifest(
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("opening database: %w", err)
|
||||
}
|
||||
|
||||
defer func() { _ = db.Close() }()
|
||||
|
||||
// Create repositories to access the data
|
||||
|
||||
Reference in New Issue
Block a user