MCPcopy
hub / github.com/connectrpc/connect-go / ExampleErrorWriter

Function ExampleErrorWriter

error_writer_example_test.go:59–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57}
58
59func ExampleErrorWriter() {
60 mux := http.NewServeMux()
61 mux.Handle("/", NewHelloHandler())
62 srv := &http.Server{
63 Addr: ":8080",
64 Handler: NewAuthenticatedHandler(mux),
65 }
66 if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
67 log.Fatalln(err)
68 }
69}

Callers

nothing calls this directly

Calls 2

NewHelloHandlerFunction · 0.85
NewAuthenticatedHandlerFunction · 0.85

Tested by

no test coverage detected