()
| 16 | } |
| 17 | |
| 18 | func (e MissingScopesError) Error() string { |
| 19 | var missing []string |
| 20 | for _, s := range e.MissingScopes { |
| 21 | missing = append(missing, fmt.Sprintf("'%s'", s)) |
| 22 | } |
| 23 | scopes := strings.Join(missing, ", ") |
| 24 | |
| 25 | if len(e.MissingScopes) == 1 { |
| 26 | return "missing required scope " + scopes |
| 27 | } |
| 28 | return "missing required scopes " + scopes |
| 29 | } |
| 30 | |
| 31 | type httpClient interface { |
| 32 | Do(*http.Request) (*http.Response, error) |