File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 6464 LimitSize int
6565
6666 // OperationNameFunc composes operation name based on context. Can be used to override default naming
67- OperationNameFunc func (ctx echo.Context ) string
67+ OperationNameFunc func (c echo.Context ) string
6868 }
6969)
7070
@@ -255,9 +255,9 @@ func generateToken() string {
255255 return fmt .Sprintf ("%x" , b )
256256}
257257
258- func defaultOperationName (ctx echo.Context ) string {
259- req := ctx .Request ()
260- return "HTTP " + req .Method + " URL: " + ctx .Path ()
258+ func defaultOperationName (c echo.Context ) string {
259+ req := c .Request ()
260+ return "HTTP " + req .Method + " URL: " + c .Path ()
261261}
262262
263263// TraceFunction wraps funtion with opentracing span adding tags for the function name and caller details
Original file line number Diff line number Diff line change @@ -354,21 +354,21 @@ func TestTraceWithCustomOperationName(t *testing.T) {
354354 e .Use (TraceWithConfig (TraceConfig {
355355 Tracer : tracer ,
356356 ComponentName : "EchoTracer" ,
357- OperationNameFunc : func (ctx echo.Context ) string {
357+ OperationNameFunc : func (c echo.Context ) string {
358358 // This is an example of operation name customization
359359 // In most cases default formatting is more than enough
360- req := ctx .Request ()
360+ req := c .Request ()
361361 opName := "HTTP " + req .Method
362362
363- path := ctx .Path ()
364- paramNames := ctx .ParamNames ()
363+ path := c .Path ()
364+ paramNames := c .ParamNames ()
365365
366366 for _ , name := range paramNames {
367367 from := ":" + name
368368 to := "{" + name + "}"
369369 path = strings .ReplaceAll (path , from , to )
370370 }
371-
371+
372372 return opName + " " + path
373373 },
374374 }))
You can’t perform that action at this time.
0 commit comments