Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophBe committed Dec 23, 2023
1 parent 468b5da commit 49add85
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 52 deletions.
8 changes: 0 additions & 8 deletions handlers/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ func (p parseDtoFromRequestServiceMock) ParseDtoFromRequest(_ *http.Request) (ty
return p.dto, p.err
}

type createEmptyModelServiceMock struct {
emptyModel types.Model
}

func (c createEmptyModelServiceMock) CreateEmptyModel(_ context.Context) types.Model {
return c.emptyModel
}

type createModelServiceMock struct {
createdModel testModel
err error
Expand Down
19 changes: 0 additions & 19 deletions handlers/mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,6 @@ func (u updateModelServiceMock) UpdateModel(_ context.Context, _ testModel) (tes
return u.model, u.err
}

type modelMock struct {
value string
createResult modelErrorHolder[types.Model]
updateResult modelErrorHolder[types.Model]
deleteResult error
}

func (m modelMock) Create(_ context.Context) (types.Model, error) {
return m.createResult.model, m.createResult.err
}

func (m modelMock) Update(_ context.Context) (types.Model, error) {
return m.updateResult.model, m.updateResult.err
}

func (m modelMock) Delete(_ context.Context) error {
return m.deleteResult
}

type errorWriterRecorder struct {
called bool
err error
Expand Down
1 change: 0 additions & 1 deletion handlers/replace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
type replaceServiceMock struct {
getOneServiceMock
updateModelServiceMock
createEmptyModelServiceMock
parseDtoFromRequestServiceMock
}

Expand Down
18 changes: 0 additions & 18 deletions types/model.go

This file was deleted.

6 changes: 0 additions & 6 deletions types/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ type GetAllService[M ModelTypeInterface] interface {
GetAll(request *http.Request) ([]M, error)
}

// CreateEmptyModelService defines the CreateEmptyModel function that is used in multiple handlers.
type CreateEmptyModelService interface {
// CreateEmptyModel returns an empty instance of the model
CreateEmptyModel(ctx context.Context) Model
}

type CreateModelService[M ModelTypeInterface] interface {
CreateModel(ctx context.Context, model M) (M, error)
}
Expand Down

0 comments on commit 49add85

Please sign in to comment.