Skip to content

Commit e9939ed

Browse files
committed
Found x.Sub(time.Now()) instead of time.Until(x)
go-lint SCC-S1024 The time.Until helper has the same effect as using x.Sub(time.Now()). The former is easier to read. Signed-off-by: Deshi Xiao <[email protected]>
1 parent 91ffd3d commit e9939ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cli/token/token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func list(app *cli.Context, cfg *cmds.Token) error {
202202
ttl := "<forever>"
203203
expires := "<never>"
204204
if token.Expires != nil {
205-
ttl = duration.ShortHumanDuration(token.Expires.Sub(time.Now()))
205+
ttl = duration.ShortHumanDuration(time.Until(token.Expires.Time))
206206
expires = token.Expires.Format(time.RFC3339)
207207
}
208208

0 commit comments

Comments
 (0)