Find a good way for Optional Arguments to functions #348

Open
opened 2020-05-23 16:03:04 +00:00 by 6543 · 1 comment
Owner

like go-github to be able to just pass nil if no option was choosen

example:
c.ListRepoMilestones(repoOwner, repoName, ListMilestoneOption{})

will be:
c.ListRepoMilestones(repoOwner, repoName, nil)

like [go-github](https://github.com/google/go-github/blob/master/github/issues_assignees.go#L17) to be able to just pass nil if no option was choosen example: `c.ListRepoMilestones(repoOwner, repoName, ListMilestoneOption{})` will be: `c.ListRepoMilestones(repoOwner, repoName, nil)`
6543 added this to the v0.13.0 milestone 2020-05-23 16:03:04 +00:00
6543 added the
kind/breaking
label 2020-05-23 16:03:04 +00:00
6543 changed title from Use for pointer for Optional Otion structs to Use Pointer for Optional Otion structs 2020-05-23 16:03:31 +00:00
6543 added the
kind/proposal
label 2020-05-23 16:05:45 +00:00
6543 modified the milestone from v0.13.0 to v0.14.0 2020-09-05 05:12:07 +00:00
Author
Owner
we perhaps should directly go this way https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
6543 removed this from the v0.14.0 milestone 2020-11-10 16:30:16 +00:00
6543 changed title from Use Pointer for Optional Otion structs to Find a good way for Optional Arguments to functions 2020-11-10 16:30:41 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/go-sdk#348
No description provided.