MCPcopy Create free account
hub / github.com/cli/cli / displayScopes

Function displayScopes

pkg/cmd/auth/status/status.go:347–356  ·  view source on GitHub ↗
(scopes string)

Source from the content-addressed store, hash-verified

345}
346
347func displayScopes(scopes string) string {
348 if scopes == "" {
349 return "none"
350 }
351 list := strings.Split(scopes, ",")
352 for i, s := range list {
353 list[i] = fmt.Sprintf("'%s'", strings.TrimSpace(s))
354 }
355 return strings.Join(list, ", ")
356}
357
358func expectScopes(token string) bool {
359 return strings.HasPrefix(token, "ghp_") || strings.HasPrefix(token, "gho_")

Callers 1

StringMethod · 0.85

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected