Adress linter issues from TLS update

This commit is contained in:
Christian Goll
2026-03-11 10:15:06 +01:00
parent 1c9757b683
commit 82b7cf9095
8 changed files with 24 additions and 24 deletions

View File

@@ -100,7 +100,7 @@ func GenTLSKeys() error {
if err != nil {
return fmt.Errorf("failed to open key file for writing: %w", err)
}
defer keyOut.Close()
defer func() { _ = keyOut.Close() }()
if err := pem.Encode(keyOut, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}); err != nil {
return fmt.Errorf("failed to write data to key file: %w", err)
}
@@ -109,7 +109,7 @@ func GenTLSKeys() error {
if err != nil {
return fmt.Errorf("failed to open cert file for writing: %w", err)
}
defer certOut.Close()
defer func() { _ = certOut.Close() }()
if err := pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil {
return fmt.Errorf("failed to write data to cert file: %w", err)
}