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.
|
|
@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 |
schachmat
left a comment
There was a problem hiding this comment.
Awesome. PR looks good.
Left one question about a codecov report which seems to be wrong.
diff/parse.go
Outdated
| 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.
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?
keegancsmith
left a comment
There was a problem hiding this comment.
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;
|
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.