From 43d54381e128c99a2fe678243ae840f56c522562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilson=20J=C3=BAnior?= Date: Mon, 15 Jul 2024 17:10:33 -0300 Subject: [PATCH] Write duration with best format for humans --- tsuru/auth/oidc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsuru/auth/oidc.go b/tsuru/auth/oidc.go index c08503a7..55f130a6 100644 --- a/tsuru/auth/oidc.go +++ b/tsuru/auth/oidc.go @@ -62,7 +62,8 @@ func oidcLogin(ctx *cmd.Context, loginInfo *authTypes.SchemeInfo) error { } fmt.Fprintln(ctx.Stderr, "Successfully logged in via OIDC!") - fmt.Fprintf(ctx.Stderr, "The OIDC token will expiry in %s\n", time.Since(t.Expiry)*-1) + tokenExpiry := time.Since(t.Expiry) * -1 + fmt.Fprintf(ctx.Stderr, "The OIDC token will expiry in %s\n", tokenExpiry.Round(time.Second)) handlerErr = config.WriteTokenV2(config.TokenV2{ Scheme: "oidc",