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