-
Notifications
You must be signed in to change notification settings - Fork 504
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
⚠️ Make all ScorecardResult format options pointers #4151
Conversation
Callers can pass in a nil pointer to use the default values. This is also consistent with AsProbe which already used a pointer. Signed-off-by: Spencer Schrock <sschrock@google.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
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.
Just curious, what's the motivation to make all of the functions return pointers instead of all return values?
From my own experience, being able to pass For example the go-gitlab often uses pointers: https://pkg.go.dev/github.com/xanzy/go-gitlab#ProjectsService.GetProject |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4151 +/- ##
==========================================
- Coverage 66.11% 60.37% -5.75%
==========================================
Files 232 212 -20
Lines 16567 15468 -1099
==========================================
- Hits 10954 9339 -1615
- Misses 4925 5433 +508
- Partials 688 696 +8 |
What kind of change does this PR introduce?
breaking change
What is the current behavior?
Some of the
AsX
functions take pointers (AsProbe
), some take structs (AsString
,AsJSON2
)What is the new behavior (if this is a feature change)?**
All three
AsX
functions which have option structs, take pointers.Which issue(s) this PR fixes
One item from #4048
Special notes for your reviewer
Does this PR introduce a user-facing change?
For user-facing changes, please add a concise, human-readable release note to
the
release-note
(In particular, describe what changes users might need to make in their
application as a result of this pull request.)