Open timwata opened 4 years ago
another example of why using structs for options doesn't work. related to #294 and #200
I think it's valid to remove "omitEmpty". It seems that is it's set to 0, it gets reset to 50 anyways.
Though just removing omitEmpty
won't fix this problem. Currently, it doesn't seem like we have a way to set a default other than the "zero value" for the integer (0).
@andygrunwald prior to version 2.0, I think we can just start implementing "Functional Options" variants of all methods, and mark the old methods as deprecated.
@ghostsquad Could be an idea. Or we just start with v2 and see if we can skip adjusting v1.
This issue has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Hey,
I am very sorry that this issue has been open for a long time with no final solution. We work on this project in our spare time, and sometimes, other priorities take over. This is the typical open source dilemma.
To provide visibility, we created the Road to v2 Milestone and calling for your feedback in https://github.com/andygrunwald/go-jira/issues/489
The development will take some time; however, I hope you can benefit from the changes. If you seek priority development for your issue + you like to sponsor it, please contact me.
We will work on this issue indirectly. This means that during the development phase, we aim to tackle it. Maybe in a different way like it is currently handled. Please understand that this will take a while because we are running this in our spare time.
Thanks for using this library. If there is anything else you would like to tell us, let us know!
Describe the bug
SearchOptions{ MaxResults:0 }
doesn't work. The API actually allows it and it's useful to get just the metadata.Expected behavior
No
Issue
returned if queried withSearchOptions{ MaxResults:0 }
Possible Solution
Remove
omitempty
fromMaxResults
https://github.com/andygrunwald/go-jira/blob/f50cb07b297d79138b13e5ab49ea33965d32f5c1/issue.go#L500-L510
and tweak
if
conditions.https://github.com/andygrunwald/go-jira/blob/f50cb07b297d79138b13e5ab49ea33965d32f5c1/issue.go#L1049-L1051
https://github.com/andygrunwald/go-jira/blob/f50cb07b297d79138b13e5ab49ea33965d32f5c1/issue.go#L1094-L1096
Your Environment
go version
): 1.14.2