Fix issues raised by linter

This commit is contained in:
Frederik Ring 2024-04-26 17:10:06 +02:00
parent 292d47eb19
commit e613f6046f
2 changed files with 4 additions and 9 deletions

View File

@ -22,8 +22,7 @@ import (
) )
func createArchive(files []string, inputFilePath, outputFilePath string, compression string, compressionConcurrency int) error { func createArchive(files []string, inputFilePath, outputFilePath string, compression string, compressionConcurrency int) error {
inputFilePath = stripTrailingSlashes(inputFilePath) _, outputFilePath, err := makeAbsolute(stripTrailingSlashes(inputFilePath), outputFilePath)
inputFilePath, outputFilePath, err := makeAbsolute(inputFilePath, outputFilePath)
if err != nil { if err != nil {
return errwrap.Wrap(err, "error transposing given file paths") return errwrap.Wrap(err, "error transposing given file paths")
} }
@ -31,7 +30,7 @@ func createArchive(files []string, inputFilePath, outputFilePath string, compres
return errwrap.Wrap(err, "error creating output file path") return errwrap.Wrap(err, "error creating output file path")
} }
if err := compress(files, outputFilePath, filepath.Dir(inputFilePath), compression, compressionConcurrency); err != nil { if err := compress(files, outputFilePath, compression, compressionConcurrency); err != nil {
return errwrap.Wrap(err, "error creating archive") return errwrap.Wrap(err, "error creating archive")
} }
@ -55,7 +54,7 @@ func makeAbsolute(inputFilePath, outputFilePath string) (string, string, error)
return inputFilePath, outputFilePath, err return inputFilePath, outputFilePath, err
} }
func compress(paths []string, outFilePath, subPath string, algo string, concurrency int) error { func compress(paths []string, outFilePath, algo string, concurrency int) error {
file, err := os.Create(outFilePath) file, err := os.Create(outFilePath)
if err != nil { if err != nil {
return errwrap.Wrap(err, "error creating out file") return errwrap.Wrap(err, "error creating out file")

View File

@ -131,12 +131,8 @@ func (c *command) schedule(strategy configStrategy) error {
c.logger.Warn( c.logger.Warn(
fmt.Sprintf("Scheduled cron expression %s will never run, is this intentional?", config.BackupCronExpression), fmt.Sprintf("Scheduled cron expression %s will never run, is this intentional?", config.BackupCronExpression),
) )
if err != nil {
return errwrap.Wrap(err, "error scheduling")
}
c.schedules = append(c.schedules, id)
} }
c.schedules = append(c.schedules, id)
} }
return nil return nil