From f15fe10c6bb0000f26ada94f4216bf216957ee2a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 20 Oct 2016 18:33:38 -0400 Subject: include a last-updated timestamp in the HTML output --- pem2html.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pem2html.go b/pem2html.go index 02918cf..fda259f 100644 --- a/pem2html.go +++ b/pem2html.go @@ -75,6 +75,9 @@ var tmpl = template.Must(template.New("pem2html"). + @@ -82,7 +85,7 @@ var tmpl = template.Must(template.New("pem2html"). -{{range $cert := .}} +{{range $cert := .certs}} @@ -93,7 +96,8 @@ var tmpl = template.Must(template.New("pem2html"). {{end}}
+

Updated {{.now.Local.Format "2006-01-02 15:04:05"}}

+
Logged NotBeforeSubject.CN Issuer.O
{{$cert.Updated.Local.Format "2006-01-02 15:04:05"}} {{$cert.X509.NotBefore.Local.Format "2006-01-02"}}
-`)) + +`)) var now = time.Now() @@ -196,5 +200,5 @@ func main() { } sort.Sort(certs) - handleErr(tmpl.Execute(os.Stdout, certs), "Could not execute template: %v\n") + handleErr(tmpl.Execute(os.Stdout, map[string]interface{}{"certs":certs, "now": now}), "Could not execute template: %v\n") } -- cgit v1.2.3-2-g168b