Hacker News new | ask | show | jobs
by derefr 1104 days ago
> A context-less function can call a contextual one by passing in a context.Background()

Yeah, but if you're calling passing context.Background() because the caller's caller had a context but you can't access it through the context-less caller, now you've got a "synchronicity leak" (a.k.a. "the program won't gracefully shut down when I press ^C.")

Golang's concurrency is an abstract machine model whose soundness you need to enforce yourself, because the compiler doesn't care about it.

If the compiler actually cared about enforcing the concurrency model, writing code like the you're describing would fail to compile, due to function coloring.