@@ -338,7 +338,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
338
338
339
339
// overwrite handler to ensure we check the ctx baggage properly
340
340
var handlerCtx context.Context
341
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
341
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
342
342
handlerCtx = r .Context ()
343
343
w .WriteHeader (http .StatusOK )
344
344
})
@@ -366,7 +366,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
366
366
367
367
// overwrite handler to ensure we check the ctx baggage properly
368
368
var handlerCtx context.Context
369
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
369
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
370
370
handlerCtx = r .Context ()
371
371
w .WriteHeader (http .StatusOK )
372
372
})
@@ -395,7 +395,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
395
395
396
396
// overwrite handler to ensure we check the ctx baggage properly
397
397
var handlerCtx context.Context
398
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
398
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
399
399
handlerCtx = r .Context ()
400
400
w .WriteHeader (http .StatusOK )
401
401
})
@@ -421,7 +421,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
421
421
422
422
// overwrite handler to ensure we check the ctx baggage properly
423
423
var handlerCtx context.Context
424
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
424
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
425
425
handlerCtx = r .Context ()
426
426
w .WriteHeader (http .StatusOK )
427
427
})
@@ -448,7 +448,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
448
448
449
449
// overwrite handler to ensure we check the ctx baggage properly
450
450
var handlerCtx context.Context
451
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
451
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
452
452
handlerCtx = r .Context ()
453
453
w .WriteHeader (http .StatusOK )
454
454
})
@@ -471,7 +471,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
471
471
472
472
// overwrite handler to ensure we check the ctx baggage properly
473
473
var handlerCtx context.Context
474
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
474
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
475
475
handlerCtx = r .Context ()
476
476
w .WriteHeader (http .StatusOK )
477
477
})
@@ -497,7 +497,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
497
497
498
498
// overwrite handler to ensure we check the ctx baggage properly
499
499
var handlerCtx context.Context
500
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
500
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
501
501
handlerCtx = r .Context ()
502
502
w .WriteHeader (http .StatusOK )
503
503
})
@@ -539,7 +539,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
539
539
540
540
// overwrite handler to ensure we check the ctx baggage properly
541
541
var handlerCtx context.Context
542
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
542
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
543
543
handlerCtx = r .Context ()
544
544
w .WriteHeader (http .StatusOK )
545
545
})
@@ -566,7 +566,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
566
566
567
567
// overwrite handler to ensure we check the ctx baggage properly
568
568
var handlerCtx context.Context
569
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
569
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
570
570
handlerCtx = r .Context ()
571
571
w .WriteHeader (http .StatusOK )
572
572
})
@@ -593,8 +593,8 @@ func TestHTTPTraceMiddleware(t *testing.T) {
593
593
req .Header .Add ("baggage" , "invalid-baggage" )
594
594
595
595
rr := httptest .NewRecorder ()
596
- fakeHandler1 : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {})
597
- handler := HTTPTraceMiddleware (fakeHandler1 , "fakeAppID" , config.TracingSpec {SamplingRate : "1" })
596
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {})
597
+ handler := HTTPTraceMiddleware (fakeHandler , "fakeAppID" , config.TracingSpec {SamplingRate : "1" })
598
598
handler .ServeHTTP (rr , req )
599
599
600
600
assert .Equal (t , http .StatusBadRequest , rr .Code )
@@ -609,8 +609,8 @@ func TestHTTPTraceMiddleware(t *testing.T) {
609
609
req .Header .Add ("baggage" , "key1=value1,key2=value2" )
610
610
611
611
rr := httptest .NewRecorder ()
612
- fakeHandler2 : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {})
613
- handler := HTTPTraceMiddleware (fakeHandler2 , "fakeAppID" , config.TracingSpec {SamplingRate : "1" })
612
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {})
613
+ handler := HTTPTraceMiddleware (fakeHandler , "fakeAppID" , config.TracingSpec {SamplingRate : "1" })
614
614
handler .ServeHTTP (rr , req )
615
615
616
616
assert .Equal (t , "key1=value1,key2=value2" , rr .Header ().Get ("baggage" ))
@@ -626,7 +626,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
626
626
627
627
// overwrite handler to ensure we check the ctx baggage properly
628
628
var handlerCtx context.Context
629
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
629
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
630
630
handlerCtx = r .Context ()
631
631
w .WriteHeader (http .StatusOK )
632
632
})
@@ -663,7 +663,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
663
663
664
664
// overwrite handler to ensure we check the ctx baggage properly
665
665
var handlerCtx context.Context
666
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
666
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
667
667
handlerCtx = r .Context ()
668
668
w .WriteHeader (http .StatusOK )
669
669
})
@@ -704,7 +704,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
704
704
705
705
// overwrite handler to ensure we check the ctx baggage properly
706
706
var handlerCtx context.Context
707
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
707
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
708
708
handlerCtx = r .Context ()
709
709
w .WriteHeader (http .StatusOK )
710
710
})
@@ -735,7 +735,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
735
735
736
736
// overwrite handler to ensure we check the ctx baggage properly
737
737
var handlerCtx context.Context
738
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
738
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
739
739
handlerCtx = r .Context ()
740
740
w .WriteHeader (http .StatusOK )
741
741
})
@@ -767,7 +767,7 @@ func TestHTTPTraceMiddleware(t *testing.T) {
767
767
768
768
// overwrite handler to ensure we check the ctx baggage properly
769
769
var handlerCtx context.Context
770
- fakeHandler : = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
770
+ fakeHandler = http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
771
771
handlerCtx = r .Context ()
772
772
w .WriteHeader (http .StatusOK )
773
773
})
0 commit comments