Skip to content

Repo.Username() + Repo.Name() helper methods #768

@tleyden

Description

@tleyden

When using go-github, I'm finding myself doing this a lot:

repoNameComponents := strings.Split(*userEvent.Repo.Name, "/")
username := repoNameComponents[0]
repoName := repoNameComponents[1]

it would be nice if there were helper methods like Repo.Username() and Repo.Name() to make this easier.

Or maybe return both in a single call:

username, reponame := Repo.Details()

I'd be willing to put together a PR if this is something that would be likely to get merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions