You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't initialized the opentracing.GlobalTracer() in my program. So it uses the Nooptracer. I expect that the operations succeed nonetheless without a panic.
If the Transport of the http client must be set to prevent the nil pointer exception, it means that we can not inject e.g. a mock http clients in tests that don't have this transport setting.
I tried to introduce http request tracing in one of our applications and stumpled about a nil pointer dereference that was triggered by a testcase.
The nil pointer dereference can be reproduced with the following program that follows the go-stdlib Godoc documentation:
I expect that either
http.DefaultClient.Do()
succeeds or returns an error (because e.g. nothing is listening onlocalhost:8080
).But it triggers the following panic in go-stdlib:
The panic happens because
h.sp
is nil when it's passed here: https://github.com/opentracing-contrib/go-stdlib/blob/master/nethttp/client.go#L255.I didn't initialized the
opentracing.GlobalTracer()
in my program. So it uses the Nooptracer. I expect that the operations succeed nonetheless without a panic.I'm using:
The text was updated successfully, but these errors were encountered: