Skip to content

Commit

Permalink
chore(lint): fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Dec 10, 2023
1 parent 94ea41e commit f042ef5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions cmd/otelfaker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ func client(ctx context.Context, lg *zap.Logger, m *app.Metrics) error {
Registry: registerer,
}))
srv := &http.Server{
Addr: "0.0.0.0:8080",
Handler: mux,
ReadHeaderTimeout: time.Second,
Addr: "0.0.0.0:8080",
Handler: mux,
}
g.Go(func() error {
lg.Info("server listening", zap.String("addr", srv.Addr))
Expand Down Expand Up @@ -58,7 +59,7 @@ func client(ctx context.Context, lg *zap.Logger, m *app.Metrics) error {
ctx, span := tracer.Start(ctx, "sendRequest")
defer span.End()

req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://server:8080/api/hello", nil)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://server:8080/api/hello", http.NoBody)
if err != nil {
lg.Error("create request", zap.Error(err))
return
Expand Down
7 changes: 3 additions & 4 deletions cmd/otelfaker/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ func server(ctx context.Context, lg *zap.Logger, m *app.Metrics) error {
w.WriteHeader(http.StatusOK)
})
srv := &http.Server{
Addr: "0.0.0.0:8080",
BaseContext: func(net.Listener) context.Context {
return ctx
},
Addr: "0.0.0.0:8080",
ReadHeaderTimeout: time.Second,
BaseContext: func(net.Listener) context.Context { return ctx },
Handler: otelhttp.NewHandler(mux, "",
otelhttp.WithMeterProvider(m.MeterProvider()),
otelhttp.WithTracerProvider(m.TracerProvider()),
Expand Down

0 comments on commit f042ef5

Please sign in to comment.