Skip to content

Commit 7483bea

Browse files
authored
chore: replace uses of %v with %w (#25400)
Replace uses of `%v` with `%w` where appropriate in file_store.go Closes: #25399 (cherry picked from commit 60e49d8)
1 parent 93d6ffc commit 7483bea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tsdb/engine/tsm1/file_store.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,18 +635,18 @@ func (f *FileStore) Open(ctx context.Context) error {
635635
// be left untouched, and the vm.max_map_count be raised.
636636
f.logger.Error("Cannot read TSM file, system limit for vm.max_map_count may be too low",
637637
zap.String("path", file.Name()), zap.Int("id", idx), zap.Error(err))
638-
readerC <- &res{r: df, err: fmt.Errorf("cannot read file %s, system limit for vm.max_map_count may be too low: %v", file.Name(), err)}
638+
readerC <- &res{r: df, err: fmt.Errorf("cannot read file %s, system limit for vm.max_map_count may be too low: %w", file.Name(), err)}
639639
return
640640
} else {
641641
// If the file is corrupt, rename it and
642642
// continue loading the shard without it.
643643
f.logger.Error("Cannot read corrupt tsm file, renaming", zap.String("path", file.Name()), zap.Int("id", idx), zap.Error(err))
644644
if e := os.Rename(file.Name(), file.Name()+"."+BadTSMFileExtension); e != nil {
645645
f.logger.Error("Cannot rename corrupt tsm file", zap.String("path", file.Name()), zap.Int("id", idx), zap.Error(e))
646-
readerC <- &res{r: df, err: fmt.Errorf("cannot rename corrupt file %s: %v", file.Name(), e)}
646+
readerC <- &res{r: df, err: fmt.Errorf("cannot rename corrupt file %s: %w", file.Name(), e)}
647647
return
648648
}
649-
readerC <- &res{r: df, err: fmt.Errorf("cannot read corrupt file %s: %v", file.Name(), err)}
649+
readerC <- &res{r: df, err: fmt.Errorf("cannot read corrupt file %s: %w", file.Name(), err)}
650650
return
651651
}
652652
}

0 commit comments

Comments
 (0)