Closed spencerschrock closed 2 weeks ago
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 nil
is slightly shorter when I just want to use the defaults. But I took a look at what some of our other libraries do, and they both use pointers for options too, so I figured that was better.
For example the go-gitlab often uses pointers: https://pkg.go.dev/github.com/xanzy/go-gitlab#ProjectsService.GetProject As does our go-github library: https://pkg.go.dev/github.com/google/go-github/github#ChecksService.ListCheckRunsForRef
Attention: Patch coverage is 48.14815%
with 14 lines
in your changes missing coverage. Please review.
Project coverage is 60.37%. Comparing base (
02f72e0
) to head (e3d71e0
). Report is 17 commits behind head on main.
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.)