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