From 7991a312f493ebc72ef7949ec24da0018784fbb3 Mon Sep 17 00:00:00 2001 From: gak Date: Mon, 19 Aug 2024 15:35:08 +1000 Subject: [PATCH] chore: lint --- backend/controller/dal/encryption.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/controller/dal/encryption.go b/backend/controller/dal/encryption.go index 365296e656..4c76e63eda 100644 --- a/backend/controller/dal/encryption.go +++ b/backend/controller/dal/encryption.go @@ -58,7 +58,7 @@ func (d *DAL) decryptJSON(subkey encryption.Subkey, encrypted []byte, v any) err return nil } -func (d *DAL) EnsureKey(ctx context.Context, generateKey func() ([]byte, error)) ([]byte, error) { +func (d *DAL) EnsureKey(ctx context.Context, generateKey func() ([]byte, error)) (encryptedKey []byte, err error) { logger := log.FromContext(ctx) tx, err := d.Begin(ctx) if err != nil { @@ -66,7 +66,7 @@ func (d *DAL) EnsureKey(ctx context.Context, generateKey func() ([]byte, error)) } defer tx.CommitOrRollback(ctx, &err) - encryptedKey, err := tx.db.GetOnlyEncryptionKey(ctx) + encryptedKey, err = tx.db.GetOnlyEncryptionKey(ctx) if err != nil && dal.IsNotFound(err) { logger.Infof("No encryption key found, generating a new one") key, err := generateKey()