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

API-Methods: Return map/slice directly, rather than a pointer to one

Open andygrunwald opened this issue 6 years ago • 0 comments

From @shurcooL in #52

Modify both ListFiles and ListFilesReviewed to return map/slice directly, rather than a pointer to one. There doesn't appear to be any value in returning a pointer, it just makes the API harder to use. Slice/map are already reference types.

...

Thoughts welcome.

I know it's not consistent with other endpoints. But I couldn't bring myself to return *[]string or *map[string]FileInfo, since I was making a breaking API change to the method anyway.

I think we should change all other methods that similarly return pointers to maps to be return just map values. If that's the agreed direction, doing this first step here makes sense. Otherwise, I should revert it.

This issue is about to make it consistent for this library :)

andygrunwald avatar Apr 29 '18 06:04 andygrunwald