go-bitbucket icon indicating copy to clipboard operation
go-bitbucket copied to clipboard

BranchRestrictions Create and Get should not return BranchRestrictions

Open DataDavD opened this issue 3 years ago • 2 comments

hey @ktrysmt I took a further look at https://github.com/ktrysmt/go-bitbucket/issues/144 and it seems like the BranchRestrictions Create and Get methods need a little work as well. I got rid of the unneeded interface type assertion for the Create tests (since it no longer returns an interface testing a type is redundant given compilation checks types for us) but still had issues with nil pointer deference in the tests which is probably due to the fact that the decode function is returning the same BranchRestrictions type but not specifying the *client.

From my review it appears that a BranchRestrictions Response type needs to be created and the decode function should return that instead.

Is that OK if I work on fixing/adding this stuff?????? The branch/PR for this Issue will close both issues related to branch restrictions.

Thanks in advance.

DataDavD avatar Jul 05 '21 00:07 DataDavD

Update/FYI I'm currently working on PR to fix this issue, so please no one duplicate this work. PR should be ready this weekend.

DataDavD avatar Jul 15 '21 17:07 DataDavD

Yes, it seems a good idea. I want to try to see a POC or PullRequest about it.

ktrysmt avatar Jul 23 '21 11:07 ktrysmt