Live data from Hacker News

I shipped a transaction bug, so I built a linter

leonh.fr

11–14 of 14 posts

Re: I shipped a transaction bug, so I built a linter

#12
post #8

I would question the framework design: the method is called "UpdateUser", so it should be executed in a transaction, so it should be a parameter of the service, and the transaction logic handled by the framework. func (s \*Service) UpdateUser(ctx context.Context, tx models.Repo, userID string) error { user, err := tx.GetUser(ctx, userID) if err != nil { return err } user.Name = "Updated" return tx.SaveUser(ctx, user)…

[deleted]
Post reply on HN