mirror of
https://github.com/onyx-and-iris/ignr.git
synced 2025-07-27 06:11:48 +00:00
17 lines
289 B
Go
17 lines
289 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/go-github/v72/github"
|
|
)
|
|
|
|
type contextKey string
|
|
|
|
const clientKey contextKey = "client"
|
|
|
|
func getClientFromContext(ctx context.Context) (*github.Client, bool) {
|
|
client, ok := ctx.Value(clientKey).(*github.Client)
|
|
return client, ok
|
|
}
|