cmd: continue lint fixes.

This commit is contained in:
2025-11-16 01:32:19 -08:00
parent f31d74243f
commit 0f77bd49dc
44 changed files with 888 additions and 875 deletions

39
cmd/readchain/main.go Normal file
View File

@@ -0,0 +1,39 @@
package main
import (
"crypto/x509"
"encoding/pem"
"flag"
"fmt"
"os"
)
func main() {
flag.Parse()
for _, fileName := range flag.Args() {
data, err := os.ReadFile(fileName)
if err != nil {
fmt.Fprintf(os.Stderr, "[!] %s: %v\n", fileName, err)
continue
}
fmt.Fprintf(os.Stdout, "[+] %s:\n", fileName)
rest := data
for {
var p *pem.Block
p, rest = pem.Decode(rest)
if p == nil {
break
}
cert, err := x509.ParseCertificate(p.Bytes)
if err != nil {
fmt.Fprintf(os.Stderr, "[!] %s: %v\n", fileName, err)
break
}
fmt.Fprintf(os.Stdout, "\t%+v\n", cert.Subject.CommonName)
}
}
}