🔧 Used already defined context as base context in HTTP requests

This commit is contained in:
Maxim Lebedev 2023-11-08 02:33:29 +06:00
parent 70b0906054
commit aaba6edc39
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5

View File

@ -5,6 +5,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"log" "log"
"net"
"net/http" "net/http"
"os" "os"
"os/signal" "os/signal"
@ -45,6 +46,7 @@ func main() {
fmt.Fprintln(w, "hello, world!") fmt.Fprintln(w, "hello, world!")
}), }),
ErrorLog: logger, ErrorLog: logger,
BaseContext: func(ln net.Listener) context.Context { return ctx },
} }
done := make(chan os.Signal, 1) done := make(chan os.Signal, 1)