-
Notifications
You must be signed in to change notification settings - Fork 49
removed pbtypes.Timestamp #51
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
removed pbtypes.Timestamp #51
Conversation
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
===========================================
+ Coverage 28.31% 75.99% +47.67%
===========================================
Files 5 4 -1
Lines 1155 454 -701
===========================================
+ Hits 327 345 +18
+ Misses 783 63 -720
- Partials 45 46 +1
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.
Left some comments.
@sqs mind taking a look at this? @sofiia-tesliuk The direct use of bytes looks a bit funky, but I'm not that familiar with whats better in the land of proto. Maybe providing a little helper around time.MarshalByte in the test cases would make this look a bit less weird. |
Using the built-in I agree that the literal |
I’m not aware of anyone using the .proto in this repo. Since we’d be breaking backcompat anyway, I think this change should also remove the whole .proto and just use Go structs as the definitions for types. Are you open to expanding this diff to do that? |
Looks like |
Yes, support for error wrapping in the standard |
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.
Awesome. PR looks good.
Left one question about a codecov report which seems to be wrong.
diff/parse.go
Outdated
@@ -304,7 +304,7 @@ func (r *FileDiffReader) ReadExtendedHeaders() ([]string, error) { | |||
var err error | |||
line, err = readLine(r.reader) | |||
if err == io.EOF { | |||
return xheaders, &ParseError{r.line, r.offset, ErrExtendedHeadersEOF} | |||
return xheaders, ParseError{r.line, r.offset, ErrExtendedHeadersEOF} |
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.
isn't this line exactly the one we're testing for in diff_test.go? Why does Codecov say that this line is not covered by tests?
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.
Requesting changes due to the change from *ParseError
to ParseError
? Is there a reason for that change?
The reason this could be bad is any checks in client code like if perr, ok := (err).(*diff.ParseError)
will now have ok never be true. While in the past it would of been. This is made worse since this won't be picked up by the compiler, is purely at runtime. Most code out in the wild hasn't migrated to things like errors.Is
/etc, so we need to support that use case.
FYI thank you so much for this change. I really like it. Just have the one concern in the above review. Otherwise LGTM. |
For `&time.Unix(1255273940, 0)` receiving an error: `cannot take the
address of time.Unix(1255273940, 0)`.
you can add a tiny helper
func unix(sec int64) *time.Time {
t := time.Unix(sec, 0)
return &t
}
|
…p.Diff for showing difference in errors;
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.
nice stuff!
Could you please also update release version to include new changes? |
@sofiia-tesliuk thanks and published v0.6.0 |
@keegancsmith Great! thank you so much! :) |
Removed custom pbtypes.Timestamp and replaced it with bytes.
It is done to remove extra dependency.