-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Change all fields from time.Time to github.Timestamp #2646
Change all fields from time.Time to github.Timestamp #2646
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2646 +/- ##
=======================================
Coverage 98.05% 98.05%
=======================================
Files 130 130
Lines 11242 11244 +2
=======================================
+ Hits 11023 11025 +2
Misses 150 150
Partials 69 69
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Composites checks prevents using unkeyed fields, which is not needed in the examples project because `time.Time` is embedded into `github.Timestamp`
issues: | ||
exclude: | ||
- composites |
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.
the examples project was having a type error, it was fixed by using github.Timestamp
, which caused another error in go vet
relating to unkeyed fields. excluding composites
fixes the error
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.
Curious what we were missing by excluding composites, I ran across these issues:
- go vet: allow disabling composites analysis golangci/golangci-lint#446
- proposal: cmd/vet: relax "composites" check to module scope golang/go#43864
in case anyone in the future finds this and wonders about it.
@willnorris - this is a significant breaking change affecting a large number of fields. Personally, I'm fine with it, but before we make such a sweeping change, I'd like to make sure you are fine with this too. |
In general, I don't really love moving away from standard Go types where it's not actually necessary. It makes it harder to interop with other libraries and existing code. In hindsight, I kinda wonder if we could have made Timestamp a time.Time rather than a struct containing a Time. ( It looks like Given that timestamps are almost exclusively read (I don't know of any GitHub API off the top of my head that involves providing a timestamp), and |
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.
Thank you, @willnorris and @zombieleet !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
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.
LGTM!
Thank you, @ganeshkumarsv ! |
Fixes: #2645. |
This PR introduces breaking API changes as described here #2645
It also fix the related test for the breaking API changes