依存例 service -> repository repository層は、単一リソースに対する処理を行う service層はrepositoryを使ってリソースに対して処理を行う 対応内容 トランザクション用のRepositoryを作成することでスッキリしたのでメモとして残しておく。 // internal/repository/tx.go package repository import ( "context" "database/sql" "github.com/uptrace/bun" // メモ用で ./ としています。通常は、"github.com/username/repo/internal/***" などになります。 "./internal/ctxkey" ) type TxRepository struct { db *bun.DB } func NewTxRepos