Drop unnecessary type conversions
This commit is contained in:
parent
f6520727a3
commit
705f3f1372
8 changed files with 16 additions and 16 deletions
|
@ -236,7 +236,7 @@ func (dc *DomainsCertificate) needRenew() bool {
|
|||
return true
|
||||
}
|
||||
// <= 30 days left, renew certificate
|
||||
if crt.NotAfter.Before(time.Now().Add(time.Duration(24 * 30 * time.Hour))) {
|
||||
if crt.NotAfter.Before(time.Now().Add(24 * 30 * time.Hour)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ func pemEncode(data interface{}) []byte {
|
|||
case *x509.CertificateRequest:
|
||||
pemBlock = &pem.Block{Type: "CERTIFICATE REQUEST", Bytes: key.Raw}
|
||||
case []byte:
|
||||
pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: []byte(data.([]byte))}
|
||||
pemBlock = &pem.Block{Type: "CERTIFICATE", Bytes: data.([]byte)}
|
||||
}
|
||||
|
||||
return pem.EncodeToMemory(pemBlock)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue