Sorry - I meant ..."calling select once per line" be a good point
On Fri, Jul 21, 2023 at 12:41 PM Gurunandan Bhat wrote:
> Hi,
>
> Are there any common patterns that standard and 3rd party library
> functions use to implement cancelling a context passed to it? I have
Hi,
Are there any common patterns that standard and 3rd party library functions
use to implement cancelling a context passed to it? I have looked at the
source of exec.CommandContext and it starts the process and spawns a
goroutine that kills the process when ctx.Done() is closed. That looks
Thanks to everyone who reassured me.
I considered posting a set of links from the most popular Golang tutorials
that do not return after calling http.Error(), but then baulked
In any case, thanks once again to all in this thread.
Regards
On Wed, Jul 5, 2023 at 4:13 AM ben...@gmail.com wrote:
Every example of http Handler that I have seen so far looks like this:
func handleSomeRequest(w http.ResponseWriter, r *http.Request) {
// do something that returns an error
if err != nil {
http.Error(w, "Something bad happened", http.SomeAppropriateStatus)
}
// do other