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
_, span:=otel.Tracer("foo").Start(context.Background(), "bar") // want "span.SetStatus is not called on all paths"
270
+
_, span:=otel.Tracer("foo").Start(context.Background(), "bar") // want "span.SetStatus is not called on all paths" "span.End is not called on all paths, possible memory leak"
270
271
deferfunc() {
271
272
iftrue {
272
273
span.End()
273
274
}
274
275
span.RecordError(err)
275
276
}()
276
277
277
-
returnerrors.New("test") // want "return can be reached without calling span.SetStatus"
278
+
returnerrors.New("test") // want "return can be reached without calling span.SetStatus" "return can be reached without calling span.End"
278
279
}
279
280
280
281
func_() (errerror) {
@@ -287,3 +288,26 @@ func _() (err error) {
287
288
288
289
returnerrors.New("test")
289
290
}
291
+
292
+
func_() (errerror) {
293
+
_, span:=otel.Tracer("foo").Start(context.Background(), "bar") // want "span.End is not called on all paths, possible memory leak"
294
+
deferfunc() {
295
+
iferr!=nil {
296
+
span.RecordError(err)
297
+
span.SetStatus(codes.Error, "test")
298
+
span.End()
299
+
}
300
+
}()
301
+
302
+
returnerrors.New("test") // want "return can be reached without calling span.End"
303
+
}
304
+
305
+
func_() (errerror) {
306
+
_, span:=otel.Tracer("foo").Start(context.Background(), "bar") // want "span.End is not called on all paths, possible memory leak"
307
+
deferfunc() {
308
+
span.RecordError(err)
309
+
span.SetStatus(codes.Error, "test")
310
+
}()
311
+
312
+
returnerrors.New("test") // want "return can be reached without calling span.End"
0 commit comments