Skip to content

Commit e613f60

Browse files
committed
Fix issues raised by linter
1 parent 292d47e commit e613f60

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

cmd/backup/archive.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@ import (
2222
)
2323

2424
func createArchive(files []string, inputFilePath, outputFilePath string, compression string, compressionConcurrency int) error {
25-
inputFilePath = stripTrailingSlashes(inputFilePath)
26-
inputFilePath, outputFilePath, err := makeAbsolute(inputFilePath, outputFilePath)
25+
_, outputFilePath, err := makeAbsolute(stripTrailingSlashes(inputFilePath), outputFilePath)
2726
if err != nil {
2827
return errwrap.Wrap(err, "error transposing given file paths")
2928
}
3029
if err := os.MkdirAll(filepath.Dir(outputFilePath), 0755); err != nil {
3130
return errwrap.Wrap(err, "error creating output file path")
3231
}
3332

34-
if err := compress(files, outputFilePath, filepath.Dir(inputFilePath), compression, compressionConcurrency); err != nil {
33+
if err := compress(files, outputFilePath, compression, compressionConcurrency); err != nil {
3534
return errwrap.Wrap(err, "error creating archive")
3635
}
3736

@@ -55,7 +54,7 @@ func makeAbsolute(inputFilePath, outputFilePath string) (string, string, error)
5554
return inputFilePath, outputFilePath, err
5655
}
5756

58-
func compress(paths []string, outFilePath, subPath string, algo string, concurrency int) error {
57+
func compress(paths []string, outFilePath, algo string, concurrency int) error {
5958
file, err := os.Create(outFilePath)
6059
if err != nil {
6160
return errwrap.Wrap(err, "error creating out file")

cmd/backup/command.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,8 @@ func (c *command) schedule(strategy configStrategy) error {
131131
c.logger.Warn(
132132
fmt.Sprintf("Scheduled cron expression %s will never run, is this intentional?", config.BackupCronExpression),
133133
)
134-
135-
if err != nil {
136-
return errwrap.Wrap(err, "error scheduling")
137-
}
138-
c.schedules = append(c.schedules, id)
139134
}
135+
c.schedules = append(c.schedules, id)
140136
}
141137

142138
return nil

0 commit comments

Comments
 (0)