Milestone Functions accept name to identify #418

Merged
6543 merged 5 commits from 6543/go-sdk:GetMilestones_add-name-to-id-resove-function into master 2020-09-15 16:29:26 +00:00
Owner
close #383 followup of #388 source https://github.com/go-gitea/gitea/pull/12649
6543 added this to the v0.13.0 milestone 2020-09-14 17:44:44 +00:00
6543 added the
kind/feature
status/needs-reviews
labels 2020-09-14 17:44:44 +00:00
6543 added 2 commits 2020-09-14 17:44:51 +00:00
add Tests
All checks were successful
continuous-integration/drone/pr Build is passing
87f5e6737b
zeripath reviewed 2020-09-14 19:19:47 +00:00
Dismissed
@ -63,2 +72,3 @@
milestone := new(Milestone)
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/milestones/%d", owner, repo, id), nil, nil, milestone)
resp, err := c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/milestones/%s", owner, repo, id), nil, nil, milestone)
Owner

The id needs a PathEscape

The id needs a PathEscape
zeripath reviewed 2020-09-14 19:20:39 +00:00
Dismissed
@ -132,3 +155,3 @@
}
milestone := new(Milestone)
resp, err := c.getParsedResponse("PATCH", fmt.Sprintf("/repos/%s/%s/milestones/%d", owner, repo, id), jsonHeader, bytes.NewReader(body), milestone)
resp, err := c.getParsedResponse("PATCH", fmt.Sprintf("/repos/%s/%s/milestones/%s", owner, repo, id), jsonHeader, bytes.NewReader(body), milestone)
Owner

simy. here

simy. here
6543 added 1 commit 2020-09-15 03:48:59 +00:00
url.PathEscape()
All checks were successful
continuous-integration/drone/pr Build is passing
21e52dcea5
Author
Owner

@zeripath done

@zeripath done
mrsdizzie approved these changes 2020-09-15 14:02:16 +00:00
Dismissed
jolheiser reviewed 2020-09-15 14:15:25 +00:00
Dismissed
jolheiser left a comment
Owner

One general nit, and then one personal nit.

I personally really dislike interface options. In my opinion if we are allowing multiple ways to get something, it should have a func for each.

Even if one of them converts an int to a string and then simply delegates back to the other, it makes library usage much cleaner imo

One general nit, and then one personal nit. I personally _really_ dislike `interface` options. In my opinion if we are allowing multiple ways to get something, it should have a func for each. Even if one of them converts an `int` to a `string` and then simply delegates back to the other, it makes library usage much cleaner imo
@ -143,0 +178,4 @@
// milestoneValueToString return string of int/int6/string and if it was converted
func milestoneValueToString(value interface{}) (string, bool, error) {
ii, ok := value.(int64)
Owner

This can all be a switch statement switch v := value.(type) {}

This can all be a switch statement `switch v := value.(type) {}`
6543 marked this conversation as resolved
6543 added 1 commit 2020-09-15 15:11:38 +00:00
do not use interface for sdk ...
All checks were successful
continuous-integration/drone/pr Build is passing
534474762b
jolheiser approved these changes 2020-09-15 15:55:59 +00:00
Dismissed
jolheiser left a comment
Owner

I think is probably a more self-documented solution.

I think is probably a more self-documented solution.
6543 removed the
status/needs-reviews
label 2020-09-15 16:21:07 +00:00
6543 added 1 commit 2020-09-15 16:22:20 +00:00
Merge branch 'master' into GetMilestones_add-name-to-id-resove-function
All checks were successful
continuous-integration/drone/pr Build is passing
1d266eee71
6543 merged commit 83da05b95f into master 2020-09-15 16:29:26 +00:00
6543 deleted branch GetMilestones_add-name-to-id-resove-func 2020-09-15 16:29:34 +00:00
Sign in to join this conversation.
No description provided.