()
| 40 | } |
| 41 | |
| 42 | func (p *FetchParams) Validate() error { |
| 43 | if p.Digest == "" { |
| 44 | return fmt.Errorf("digest must be provided") |
| 45 | } |
| 46 | if p.Limit <= 0 || p.Limit > maxLimitForFlag { |
| 47 | return fmt.Errorf("limit must be greater than 0 and less than or equal to %d", maxLimitForFlag) |
| 48 | } |
| 49 | if p.Repo == "" && p.Owner == "" { |
| 50 | return fmt.Errorf("owner or repo must be provided") |
| 51 | } |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | // githubApiClient makes REST calls to the GitHub API |
| 56 | type githubApiClient interface { |
no test coverage detected