SkyAPM / go2sky

Distributed tracing and monitor SDK in Go for Apache SkyWalking APM
https://skywalking.apache.org/
Apache License 2.0
447 stars 122 forks source link

Fix panic when calling putCorrelation #95

Closed mrproliu closed 3 years ago

mrproliu commented 3 years ago

When current is has existing tracing context and empty correlation context, calling the go2sky.putCorrelation method will throw a panic.

So when creating the segment context, should check the correlation is empty, if so, need to add the default map.

codecov-io commented 3 years ago

Codecov Report

Merging #95 (6ec2474) into master (fa1294c) will increase coverage by 0.10%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #95      +/-   ##
==========================================
+ Coverage   67.08%   67.18%   +0.10%     
==========================================
  Files          14       14              
  Lines         641      643       +2     
==========================================
+ Hits          430      432       +2     
  Misses        171      171              
  Partials       40       40              
Impacted Files Coverage Δ
segment.go 91.30% <100.00%> (+0.19%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update fa1294c...6ec2474. Read the comment docs.