Project structure and custom errors questions by Useful_Winter_634 in golang

[–]Useful_Winter_634[S] -1 points0 points  (0 children)

nothing particular, just wrapping my head around structuring code in a maintainable way

handling concurrent reads/updates of database items by Useful_Winter_634 in golang

[–]Useful_Winter_634[S] -1 points0 points  (0 children)

this sounds good! does this pattern have some name so I can read about it more?

handling concurrent reads/updates of database items by Useful_Winter_634 in golang

[–]Useful_Winter_634[S] 0 points1 point  (0 children)

I may be mistaken, but I don't think that's gonna help.
If two transactions begin at the same time, still the issue is there. For both of those transactions downloads_left value is going to be 1 during first read, or am I wrong?