Rebase over master and a few more linter fixes

This commit is contained in:
max furman 2022-09-20 16:32:49 -07:00
parent 18a648cffa
commit 6af9437875
No known key found for this signature in database
3 changed files with 10 additions and 11 deletions

View file

@ -60,8 +60,7 @@ func (t Type) String() string {
} }
// NotImplementedError 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 NotImplementedError struct { //nolint:errname // ignore error name warning type NotImplementedError struct {
Message string Message string
} }

View file

@ -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 { type fields struct {
Message string Message string
} }
@ -38,17 +38,17 @@ func TestErrNotImplemented_Error(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
e := ErrNotImplemented{ e := NotImplementedError{
Message: tt.fields.Message, Message: tt.fields.Message,
} }
if got := e.Error(); got != tt.want { 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 { type fields struct {
Message string Message string
} }
@ -62,11 +62,11 @@ func TestErrNotImplemented_StatusCode(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
s := ErrNotImplemented{ s := NotImplementedError{
Message: tt.fields.Message, Message: tt.fields.Message,
} }
if got := s.StatusCode(); got != tt.want { 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)
} }
}) })
} }

View file

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