Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pirosiki197 committed Jan 15, 2025
1 parent 1a8a63e commit ea52719
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions server/repository/db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func createDatabase(name string) error {
return err
}

// retry retries f until it returns nil or max retries are reached. panic if max retries are reached.
func retry(max int, f func() error) {
// retry retries f until it returns nil or n retries are reached. panic if n retries are reached.
func retry(n int, f func() error) {
var err error
for i := 0; i < max; i++ {
for i := 0; i < n; i++ {
err = f()
if err == nil {
return
Expand Down
2 changes: 1 addition & 1 deletion server/repository/db/team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestUpdateTeam(t *testing.T) {

// change the team name and add a new member
team.Name = "team2"
team.AddMember(newMember)
require.NoError(t, team.AddMember(newMember))
err := repo.UpdateTeam(context.Background(), team)
assert.NoError(t, err)

Expand Down
2 changes: 1 addition & 1 deletion server/usecase/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package usecase

import "errors"

type UseCaseError struct {
type UseCaseError struct { //nolint revive
err error
}

Expand Down
6 changes: 3 additions & 3 deletions server/usecase/team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestCreateTeam(t *testing.T) {
expectError: true,
setup: func() {
mockRepo.EXPECT().FindUser(gomock.Any(), gomock.Any()).
DoAndReturn(func(ctx context.Context, id uuid.UUID) (domain.User, error) {
DoAndReturn(func(_ context.Context, id uuid.UUID) (domain.User, error) {
return domain.User{ID: id}, nil
}).Times(4)
},
Expand Down Expand Up @@ -152,11 +152,11 @@ func TestUpdateTeam(t *testing.T) {
expectError: true,
setup: func() {
mockRepo.EXPECT().FindTeam(gomock.Any(), gomock.Any()).
DoAndReturn(func(ctx context.Context, id uuid.UUID) (domain.Team, error) {
DoAndReturn(func(_ context.Context, id uuid.UUID) (domain.Team, error) {
return domain.Team{ID: id}, nil
})
mockRepo.EXPECT().FindUser(gomock.Any(), gomock.Any()).
DoAndReturn(func(ctx context.Context, id uuid.UUID) (domain.User, error) {
DoAndReturn(func(_ context.Context, id uuid.UUID) (domain.User, error) {
return domain.User{ID: id}, nil
}).Times(4)
},
Expand Down

0 comments on commit ea52719

Please sign in to comment.