Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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