🔧 Used already defined context as base context in HTTP requests
This commit is contained in:
parent
70b0906054
commit
aaba6edc39
2
main.go
2
main.go
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user