Просмотр исходного кода

Fix linter warning about bad error name

max furman 4 лет назад
Родитель
Сommit
18a648cffa
3 измененных файлов с 7 добавлено и 7 удалено
  1. 5 5
      cas/apiv1/services.go
  2. 1 1
      cas/stepcas/stepcas.go
  3. 1 1
      cas/vaultcas/vaultcas.go

+ 5 - 5
cas/apiv1/services.go

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

+ 1 - 1
cas/stepcas/stepcas.go

@@ -101,7 +101,7 @@ func (s *StepCAS) CreateCertificate(req *apiv1.CreateCertificateRequest) (*apiv1
 // RenewCertificate will always return a non-implemented error as mTLS renewals
 // are not supported yet.
 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.

+ 1 - 1
cas/vaultcas/vaultcas.go

@@ -162,7 +162,7 @@ func (v *VaultCAS) GetCertificateAuthority(req *apiv1.GetCertificateAuthorityReq
 // RenewCertificate will always return a non-implemented error as renewals
 // are not supported yet.
 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.