func NewGitHubProvider(token string, options Options) Provider {
	client := github.NewClient(oauth2.NewClient(
		context.Background(),
		oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}),
	))

	if options.BaseURL != "" {
		baseParsedURL, err := url.Parse(options.BaseURL)
		if err != nil {
			panic(fmt.Sprintf("Github Base URL is not a valid url: %v", options.BaseURL))
		}

		client.BaseURL = baseParsedURL
	}

	return &GitHubProvider{
		client:     client,
		options:    options,
		token:      token,
		totalPages: unknownTotal,
		isOrg:      true,
	}
}
// NewGitHubProvider creates a new Github Provider.
NewGitHubProvider creates a new Github Provider.
// NewGitHubProvider creates a new Github Provider .
func NewGitHubProvider(token string, options Options) Provider {
	client := github.NewClient(oauth2.NewClient(
		context.Background(),
		oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}),
	))
	if options.BaseURL != "" {
		baseParsedURL, err := url.Parse(options.BaseURL)
		if err != nil {
			panic(fmt.Sprintf("Github Base URL is not a valid url: %v", options.BaseURL))
		}
		client.BaseURL = baseParsedURL
	}
	return &GitHubProvider{
		client:     client,
		options:    options,
		token:      token,
		totalPages: unknownTotal,
		isOrg:      true,
	}
}
func NewGitHubProvider ( token string , options Options ) Provider { client := github . NewClient ( oauth2 . NewClient ( context . Background ( ) , oauth2 . StaticTokenSource ( & oauth2 . Token { AccessToken : token } ) , ) ) if options . BaseURL != " " { baseParsedURL , err := url . Parse ( options . BaseURL ) if err != nil { panic ( fmt . Sprintf ( " " , options . BaseURL ) ) } client . BaseURL = baseParsedURL } return & GitHubProvider { client : client , options : options , token : token , totalPages : unknownTotal , isOrg : true , } }
NewGitHubProvider creates a new Github Provider.
NewGitHubProvider creates a new Github Provider .