fix(middleware/tracing): golang filename modify (#2727)

pull/2612/head
jessetang 2 years ago committed by GitHub
parent d470886977
commit f03f5f8988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      middleware/tracing/statshandler.go
  2. 8
      middleware/tracing/statshandler_test.go

@ -31,9 +31,9 @@ func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
if !ok {
return
}
remoteAddr := p.Addr.String()
if span := trace.SpanFromContext(ctx); span.SpanContext().IsValid() {
span.SetAttributes(peerAttr(remoteAddr)...)
span := trace.SpanFromContext(ctx)
if span.SpanContext().IsValid() {
span.SetAttributes(peerAttr(p.Addr.String())...)
}
}

@ -18,7 +18,7 @@ func TestClient_HandleConn(_ *testing.T) {
(&ClientHandler{}).HandleConn(context.Background(), nil)
}
func Test_Client_TagConn(t *testing.T) {
func TestClient_TagConn(t *testing.T) {
client := &ClientHandler{}
ctx := context.WithValue(context.Background(), testKey, 123)
@ -27,7 +27,7 @@ func Test_Client_TagConn(t *testing.T) {
}
}
func Test_Client_TagRPC(t *testing.T) {
func TestClient_TagRPC(t *testing.T) {
client := &ClientHandler{}
ctx := context.WithValue(context.Background(), testKey, 123)
@ -36,12 +36,10 @@ func Test_Client_TagRPC(t *testing.T) {
}
}
type (
mockSpan struct {
type mockSpan struct {
trace.Span
mockSpanCtx *trace.SpanContext
}
)
func (m *mockSpan) SpanContext() trace.SpanContext {
return *m.mockSpanCtx
Loading…
Cancel
Save