andygrunwald / andygrunwald/go-gerrit

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

Open
#53 0 comments 2 reactions 0 assignees View on GitHub
breaking-change enhancement
Dominant language
Go
Stars
106
Forks
54
Avg merge
7h 21m
Merged PRs (30d)
3

Description

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 :)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.