1
0
mirror of https://github.com/golang/go synced 2024-11-15 00:50:32 -07:00

Use fmt.Errorf, adjust error message

This commit is contained in:
Techassi 2024-05-06 09:33:50 +02:00
parent 0ed2f97fbd
commit b855a161d4
No known key found for this signature in database
GPG Key ID: 79B0FFFB2F07C0B7

View File

@ -964,7 +964,7 @@ func parseCertificate(der []byte) (*Certificate, error) {
}
oidStr := ext.Id.String()
if seenExts[oidStr] {
return nil, errors.New("x509: certificate contains duplicate extension %s", oidStr)
return nil, fmt.Errorf("x509: certificate contains duplicate extension with OID %q", oidStr)
}
seenExts[oidStr] = true
cert.Extensions = append(cert.Extensions, ext)