u/Electronic_Code_1535

▲ 30 r/golang

When you have like 2 repositories that you are updating or inserting and they should save or not in a single transaction, how do you do that in Golang?
I'm doing the following now:
return a dbctx.Resolve(ctx, r.db, fn)
use this returned context and pass to the function/method that will update the DB.
I'm coming from a Python background so I'm not sure the best approach in Golang.

reddit.com
u/Electronic_Code_1535 — 14 days ago