Pārlūkot izejas kodu

Rebase over master and a few more linter fixes

max furman 4 gadi atpakaļ
vecāks
revīzija
6af9437875
3 mainītis faili ar 10 papildinājumiem un 11 dzēšanām
  1. 1 2
      cas/apiv1/services.go
  2. 6 6
      cas/apiv1/services_test.go
  3. 3 3
      cas/stepcas/issuer_test.go

+ 1 - 2
cas/apiv1/services.go

@@ -60,8 +60,7 @@ func (t Type) String() string {
 }
 
 // NotImplementedError is the type of error returned if an operation is not implemented.
-type NotImplementedError struct { //nolint:errname // ignore error name warning
-
+type NotImplementedError struct {
 	Message string
 }
 

+ 6 - 6
cas/apiv1/services_test.go

@@ -24,7 +24,7 @@ func TestType_String(t *testing.T) {
 	}
 }
 
-func TestErrNotImplemented_Error(t *testing.T) {
+func TestNotImplementedError_Error(t *testing.T) {
 	type fields struct {
 		Message string
 	}
@@ -38,17 +38,17 @@ func TestErrNotImplemented_Error(t *testing.T) {
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			e := ErrNotImplemented{
+			e := NotImplementedError{
 				Message: tt.fields.Message,
 			}
 			if got := e.Error(); got != tt.want {
-				t.Errorf("ErrNotImplemented.Error() = %v, want %v", got, tt.want)
+				t.Errorf("NotImplementedError.Error() = %v, want %v", got, tt.want)
 			}
 		})
 	}
 }
 
-func TestErrNotImplemented_StatusCode(t *testing.T) {
+func TestNotImplementedError_StatusCode(t *testing.T) {
 	type fields struct {
 		Message string
 	}
@@ -62,11 +62,11 @@ func TestErrNotImplemented_StatusCode(t *testing.T) {
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			s := ErrNotImplemented{
+			s := NotImplementedError{
 				Message: tt.fields.Message,
 			}
 			if got := s.StatusCode(); got != tt.want {
-				t.Errorf("ErrNotImplemented.StatusCode() = %v, want %v", got, tt.want)
+				t.Errorf("NotImplementedError.StatusCode() = %v, want %v", got, tt.want)
 			}
 		})
 	}

+ 3 - 3
cas/stepcas/issuer_test.go

@@ -15,11 +15,11 @@ import (
 type mockErrIssuer struct{}
 
 func (m mockErrIssuer) SignToken(subject string, sans []string, info *raInfo) (string, error) {
-	return "", apiv1.ErrNotImplemented{}
+	return "", apiv1.NotImplementedError{}
 }
 
 func (m mockErrIssuer) RevokeToken(subject string) (string, error) {
-	return "", apiv1.ErrNotImplemented{}
+	return "", apiv1.NotImplementedError{}
 }
 
 func (m mockErrIssuer) Lifetime(d time.Duration) time.Duration {
@@ -29,7 +29,7 @@ func (m mockErrIssuer) Lifetime(d time.Duration) time.Duration {
 type mockErrSigner struct{}
 
 func (s *mockErrSigner) Sign(payload []byte) (*jose.JSONWebSignature, error) {
-	return nil, apiv1.ErrNotImplemented{}
+	return nil, apiv1.NotImplementedError{}
 }
 
 func (s *mockErrSigner) Options() jose.SignerOptions {