Skip to content

Commit cd61856

Browse files
committed
fix QF1009 rule from staticcheck
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 9a3c521 commit cd61856

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

.golangci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ linters:
250250
checks:
251251
- all
252252
- -QF1008 # Omit embedded fields from selector expression
253-
- -QF1009 # Use time.Time.Equal instead of == operator
254253
- -QF1012 # Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))
255254

256255
testifylint:

pkg/cmd/util/output/backup_printer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func humanReadableTimeFromNow(when time.Time) string {
121121

122122
now := time.Now()
123123
switch {
124-
case when == now || when.After(now):
124+
case when.Equal(now) || when.After(now):
125125
return duration.ShortHumanDuration(when.Sub(now))
126126
default:
127127
return fmt.Sprintf("%s ago", duration.ShortHumanDuration(now.Sub(when)))

0 commit comments

Comments
 (0)