Skip to content
Snippets Groups Projects
Unverified Commit 601a1697 authored by Max Adamo's avatar Max Adamo
Browse files

feat: add conditional sorting for certificate results based on suffix parameter

parent 8e1cd6af
No related branches found
No related tags found
No related merge requests found
......@@ -109,9 +109,15 @@ func ProcessCertificatesWrite(baseDir, provider string, outputDir string, verbos
wg.Wait()
sort.Slice(results, func(i, j int) bool {
return results[i].CertName < results[j].CertName
})
if suffix == "" {
sort.Slice(results, func(i, j int) bool {
return results[i].CertName < results[j].CertName
})
} else {
sort.Slice(results, func(i, j int) bool {
return results[i].ExpiryDate < results[j].ExpiryDate
})
}
outputFile := filepath.Join(outputDir, provider+suffix+".json")
return writeJSON(outputFile, results, verboseBool)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment