From a2082c2dba0aba666399342588bdf05d1af1685d Mon Sep 17 00:00:00 2001 From: pirosiki197 Date: Tue, 2 Apr 2024 21:43:14 +0900 Subject: [PATCH] =?UTF-8?q?named=20return=E3=82=92=E3=82=84=E3=82=81?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/infrastructure/repository/environment.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/infrastructure/repository/environment.go b/pkg/infrastructure/repository/environment.go index 6b0912d9..5cbaaf3a 100644 --- a/pkg/infrastructure/repository/environment.go +++ b/pkg/infrastructure/repository/environment.go @@ -44,17 +44,13 @@ func (r *environmentRepository) GetEnv(ctx context.Context, cond domain.GetEnvCo return ds.Map(environments, repoconvert.ToDomainEnvironment), nil } -func (r *environmentRepository) SetEnv(ctx context.Context, env *domain.Environment) (err error) { +func (r *environmentRepository) SetEnv(ctx context.Context, env *domain.Environment) error { // NOTE: sqlboiler does not recognize multiple column unique keys: https://github.com/volatiletech/sqlboiler/issues/328 tx, err := r.db.BeginTx(ctx, nil) if err != nil { return errors.Wrap(err, "failed to start transaction") } - defer func() { - if err != nil { - tx.Rollback() - } - }() + defer tx.Rollback() _, err = models.Applications( qm.Select(models.ApplicationColumns.ID),