Skip to content

Commit

Permalink
trivial. fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed Sep 12, 2023
1 parent e92ed11 commit c5cd804
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 43 deletions.
4 changes: 2 additions & 2 deletions internal/repository/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ func reflectAlert(alert Alert) (out domain.Alert) {
log.Error(err)
}

outAlertActions := make([]domain.AlertAction, len(alert.AlertActions))
if err := serializer.Map(outAlertActions, &out.AlertActions); err != nil {
out.AlertActions = make([]domain.AlertAction, len(alert.AlertActions))
if err := serializer.Map(alert.AlertActions, &out.AlertActions); err != nil {
log.Error(err)
}
return
Expand Down
8 changes: 0 additions & 8 deletions internal/repository/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,3 @@ func reflectCluster(cluster Cluster) (out domain.Cluster) {
}
return
}

func reflectSimpleCluster(cluster Cluster) domain.Cluster {
return domain.Cluster{
ID: cluster.ID,
OrganizationId: cluster.OrganizationId,
Name: cluster.Name,
}
}
20 changes: 0 additions & 20 deletions internal/repository/stack-template.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,6 @@ func (r *StackTemplateRepository) Delete(dto domain.StackTemplate) (err error) {
return nil
}

func reflectStackTemplate2(stackTemplate StackTemplate) (out domain.StackTemplate) {
return domain.StackTemplate{
ID: stackTemplate.ID,
OrganizationId: stackTemplate.OrganizationId,
Name: stackTemplate.Name,
Description: stackTemplate.Description,
Template: stackTemplate.Template,
CloudService: stackTemplate.CloudService,
Platform: stackTemplate.Platform,
Version: stackTemplate.Version,
KubeVersion: stackTemplate.KubeVersion,
KubeType: stackTemplate.KubeType,
Services: stackTemplate.Services,
Creator: reflectSimpleUser(stackTemplate.Creator),
Updator: reflectSimpleUser(stackTemplate.Updator),
CreatedAt: stackTemplate.CreatedAt,
UpdatedAt: stackTemplate.UpdatedAt,
}
}

func reflectStackTemplate(stackTemplate StackTemplate) (out domain.StackTemplate) {
if err := serializer.Map(stackTemplate, &out); err != nil {
log.Error(err)
Expand Down
13 changes: 0 additions & 13 deletions internal/repository/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,3 @@ func (r *UserRepository) reflectRole(role Role) domain.Role {
UpdatedAt: role.UpdatedAt,
}
}

func reflectSimpleUser(user User) domain.User {
return domain.User{
ID: user.ID.String(),
AccountId: user.AccountId,
Name: user.Name,
Email: user.Email,
Department: user.Department,
Description: user.Description,
CreatedAt: user.CreatedAt,
UpdatedAt: user.UpdatedAt,
}
}

0 comments on commit c5cd804

Please sign in to comment.