From eff0fdffcd3e266264966e244ea88c183fd47b62 Mon Sep 17 00:00:00 2001 From: Manuel Mendez <708570+mmlb@users.noreply.github.com> Date: Thu, 9 May 2019 08:17:52 -0400 Subject: [PATCH] adapters: remove never taken branch (#68) This code seems to be a copy-paste of code called in a `recover` func in Sensor.WriteTracingSpan. In TracingHttpRequest `err` is known to be an error so the first branch will always be taken. --- adapters.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/adapters.go b/adapters.go index 7fa5c8f17..6bb678bf2 100644 --- a/adapters.go +++ b/adapters.go @@ -87,11 +87,7 @@ func (s *Sensor) TracingHttpRequest(name string, parent, req *http.Request, clie span.SetTag(string(ext.HTTPStatusCode), res.StatusCode) if err != nil { - if e, ok := err.(error); ok { - span.LogFields(otlog.Error(e)) - } else { - span.LogFields(otlog.Object("error", err)) - } + span.LogFields(otlog.Error(err)) } return }