From 94864c67065e799c0d59012114053d5b34e5510a Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Sun, 11 Mar 2018 10:56:33 -0400 Subject: [PATCH] cleanup deadcode Signed-off-by: Jess Frazelle --- main.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/main.go b/main.go index c27f65b..1643b34 100644 --- a/main.go +++ b/main.go @@ -217,7 +217,7 @@ func createHost(name string, twarn time.Time, cert *x509.Certificate) host { if twarn.After(cert.NotAfter) { host.warn = true } - expiresIn := int64(cert.NotAfter.Sub(time.Now()).Hours()) + expiresIn := int64(time.Until(cert.NotAfter).Hours()) if expiresIn <= 48 { host.expires = fmt.Sprintf("%d hours", expiresIn) } else { @@ -234,13 +234,3 @@ func createHost(name string, twarn time.Time, cert *x509.Certificate) host { return host } - -func usageAndExit(message string, exitCode int) { - if message != "" { - fmt.Fprintf(os.Stderr, message) - fmt.Fprintf(os.Stderr, "\n\n") - } - flag.Usage() - fmt.Fprintf(os.Stderr, "\n") - os.Exit(exitCode) -}