|
|
|
|
|
by BreakfastB0b
1246 days ago
|
|
You’re correct that they’re fundamentally different things, I didn’t mean to draw a false equivalence between them. The comparison I was trying to draw between them was the way they infect the call tree and usually demarcate impure functions. When I said that context.Background() discharges the constraint I meant in the sense that the caller doesn’t need to propagate that argument to its caller as it can just pull a context out of thin air. However I’ve seen a lot of new go devs confuse context.Background() for forking things into the background. For what it’s worth, I think coloured functions are actually a good thing. If you’re following clean architecture or something similar coloured functions help you easily distinguish what layer in your application something belongs to. |
|