Skip to content

RepositoriesService.ReplaceAllTopics has *Topics parameter, it'd be better made a value. #773

@dmitshur

Description

@dmitshur

I just noticed the signature of RepositoriesService.ReplaceAllTopics has a *Topic parameter.

The parameter is not optional, it's mandatory. See https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository:

image

There's no value in making it a pointer rather than value, only harm, because it makes it possible to pass nil value.

I suggest we making a breaking API change to improve the API of go-github and change the signature of the method to:

func (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string,
    topics Topics) (*Topics, *Response, error)

This is a new method, still under a preview API, so a breaking change is acceptable IMO, as long as it leads to an improve go-github API.

/cc @gmlewis

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions