Skip to content

Instantly share code, notes, and snippets.

View massoudasadi's full-sized avatar
🏠
Working from home

Massoud Asadi massoudasadi

🏠
Working from home
View GitHub Profile
@massoudasadi
massoudasadi / context.go
Created June 7, 2022 18:24 — forked from montanaflynn/context.go
An example of using context to cancel goroutines between server handlers
package main
import (
"context"
"fmt"
"log"
"net/http"
"sync"
"time"
)