Fix linter warning about bad error name

pull/1062/head
max furman 2 years ago
parent 1e0ea6f958
commit 18a648cffa
No known key found for this signature in database

@ -59,14 +59,14 @@ func (t Type) String() string {
return strings.ToLower(string(t)) return strings.ToLower(string(t))
} }
// ErrNotImplemented is the type of error returned if an operation is not implemented. // NotImplementedError is the type of error returned if an operation is not implemented.
type ErrNotImplemented struct { //nolint:errname // ignore error name warning type NotImplementedError struct { //nolint:errname // ignore error name warning
Message string Message string
} }
// ErrNotImplemented implements the error interface. // NotImplementedError implements the error interface.
func (e ErrNotImplemented) Error() string { func (e NotImplementedError) Error() string {
if e.Message != "" { if e.Message != "" {
return e.Message return e.Message
} }
@ -75,6 +75,6 @@ func (e ErrNotImplemented) Error() string {
// StatusCode implements the StatusCoder interface and returns the HTTP 501 // StatusCode implements the StatusCoder interface and returns the HTTP 501
// error. // error.
func (e ErrNotImplemented) StatusCode() int { func (e NotImplementedError) StatusCode() int {
return http.StatusNotImplemented return http.StatusNotImplemented
} }

@ -101,7 +101,7 @@ func (s *StepCAS) CreateCertificate(req *apiv1.CreateCertificateRequest) (*apiv1
// RenewCertificate will always return a non-implemented error as mTLS renewals // RenewCertificate will always return a non-implemented error as mTLS renewals
// are not supported yet. // are not supported yet.
func (s *StepCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) { func (s *StepCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) {
return nil, apiv1.ErrNotImplemented{Message: "stepCAS does not support mTLS renewals"} return nil, apiv1.NotImplementedError{Message: "stepCAS does not support mTLS renewals"}
} }
// RevokeCertificate revokes a certificate. // RevokeCertificate revokes a certificate.

@ -162,7 +162,7 @@ func (v *VaultCAS) GetCertificateAuthority(req *apiv1.GetCertificateAuthorityReq
// RenewCertificate will always return a non-implemented error as renewals // RenewCertificate will always return a non-implemented error as renewals
// are not supported yet. // are not supported yet.
func (v *VaultCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) { func (v *VaultCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) {
return nil, apiv1.ErrNotImplemented{Message: "vaultCAS does not support renewals"} return nil, apiv1.NotImplementedError{Message: "vaultCAS does not support renewals"}
} }
// RevokeCertificate revokes a certificate by serial number. // RevokeCertificate revokes a certificate by serial number.

Loading…
Cancel
Save