-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor zipkin/protov2.go #1747
Conversation
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
crossdock-go test failed, i think its flaky and unrelated to this PR. Is there something we can do to fix that? so CI wouldn't break for any PRs in future |
Codecov Report
@@ Coverage Diff @@
## master #1747 +/- ##
==========================================
+ Coverage 98.35% 98.35% +<.01%
==========================================
Files 194 194
Lines 9527 9531 +4
==========================================
+ Hits 9370 9374 +4
Misses 123 123
Partials 34 34
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the follow-up
return TraceID{}, fmt.Errorf("invalid length for TraceID") | ||
} | ||
return t, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're adding a new function, I would prefer to reuse it from Unmarshal(data []byte)
, e.g.
func (t *TraceID) Unmarshal(data []byte) error {
var err error
*t, err = TraceIDFromBytes(data)
return err
}
Similar for Unmarshal on SpanID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. And this change would let func (t *TraceID) Unmarshal
parse 8byte long TraceID(Higher 8bytes will be 0)
Signed-off-by: Abhilash Gnan <[email protected]>
Which problem is this PR solving?
Short description of the changes
model/ids.go
to parse[]byte
into SpanID/TraceIDmodel/ids.go
inzipkin/protov2.go