Skip to content

Add NewTokenClient constructor #2636

@icholy

Description

@icholy

I often write one-off tools using this module and I keep needing to come back to the docs to copy/paste this snippet.

client := github.NewClient(
	oauth2.NewClient(
		ctx, oauth2.StaticTokenSource(
			&oauth2.Token{
				AccessToken: token,
			},
		),
	),
)

It would be nice if there was a helper to do this.

client := github.NewTokenClient(ctx, token)

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