mirror of
https://github.com/onyx-and-iris/ignr.git
synced 2025-07-26 22:01:57 +00:00
17 lines
288 B
Go
17 lines
288 B
Go
package cmd
|
|
|
|
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
|
|
}
|