fix!: Pass url struct tags by value instead of by reference#3991
fix!: Pass url struct tags by value instead of by reference#3991gmlewis merged 8 commits intogoogle:masterfrom
url struct tags by value instead of by reference#3991Conversation
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3991 +/- ##
=======================================
Coverage 93.52% 93.52%
=======================================
Files 207 207
Lines 17590 17590
=======================================
Hits 16451 16451
Misses 938 938
Partials 201 201 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
|
If any of you have time to review, that would be greatly appreciated. cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra |
|
Also, should we update all the struct in this PR? I believe a lot of struct need to be change |
In this PR, I updated the ones that I know are "safe" - all the pagination ones, etc. I left the others for later review on a one-by-one basis. |
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
|
Thank you, @Not-Dhananjay-Mishra and @alexandear, for the great review feedback! |
|
Oh! And here's one other idea I had for the Thoughts? |
Great idea. Let's add it to |
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
OK, I've incorporated it and pushed the change... amazing that the change was trivial... the comments were more difficult to write. 😂 Here is an example run to show that it is working: Now I'm wondering if might be confusing to end-users? |
I think we should tell the end users that script has done some changes in |
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
OK, I thought I saw something wrong, but I think this is what we are ending up with: I saw that "Removed" for the |
If we can't avoid that, I think then it's fine to remove that print statement 🙃 |
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
OK, then |
|
Thank you, @alexandear and @Not-Dhananjay-Mishra! |
BREAKING CHANGE: Many
*Optionsstructs now passomitemptyURL struct fields by value instead of by reference.Fixes: #3990.
Relates to: #3984.
Over time, I had allowed and even encouraged pointers to primitive types to be used in the URL struct tags when "omitempty" was provided. This violates the spirit of the purpose of the use of pointers for GitHub resource types as declared in this repo's README.md, and this is the first step to getting back on track to a self-consistent client library.
I apologize for the breakages that this PR causes and for all the contributors whom I wrongly steered during code reviews.
Note that timestamps can still be passed by reference (or by value if using
omitzero).Also note that a new
check-structfield-settingstool is added to this repo that will report (and optionally-fix) any obsolete exceptions listed in the.golangci.ymlfile at the root of the repo.