From 5704048d4bcb1a624da2a44f594d6f7e4af6c268 Mon Sep 17 00:00:00 2001 From: "Stefan J. Betz" Date: Sat, 28 Sep 2024 21:07:28 +0200 Subject: [PATCH] filename as pointer --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 141084a..908d01a 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ type Certificate struct { Expired *time.Time Revoked *time.Time Serial string - Filename string + Filename *string CN string } @@ -60,7 +60,10 @@ func (c *Certificates) process_line(line []string) { cert.Revoked = revoked } cert.Status = line[CERT_STATUS] - cert.Filename = line[CERT_FILENAME] + filename := &line[CERT_FILENAME] + if *filename != "unknown" { + cert.Filename = &line[CERT_FILENAME] + } cert.Serial = line[CERT_SERIAL] switch cert.Status { case "V":