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 {
inputFilePath = stripTrailingSlashes(inputFilePath)
inputFilePath, outputFilePath, err := makeAbsolute(inputFilePath, outputFilePath)
_, outputFilePath, err := makeAbsolute(stripTrailingSlashes(inputFilePath), outputFilePath)
if err != nil {
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")
}
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")
}
@ -55,7 +54,7 @@ func makeAbsolute(inputFilePath, outputFilePath string) (string, string, error)
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)
if err != nil {
return errwrap.Wrap(err, "error creating out file")

View File

@ -131,13 +131,9 @@ func (c *command) schedule(strategy configStrategy) error {
c.logger.Warn(
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)
}
}
return nil
}