(p *Project, meta *RepoMeta)
| 587 | } |
| 588 | |
| 589 | func writeCachedMeta(p *Project, meta *RepoMeta) error { |
| 590 | path := cacheFilePath(p) |
| 591 | if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { |
| 592 | return err |
| 593 | } |
| 594 | |
| 595 | data, err := json.MarshalIndent(meta, "", " ") |
| 596 | if err != nil { |
| 597 | return err |
| 598 | } |
| 599 | |
| 600 | return os.WriteFile(path, data, 0644) |
| 601 | } |
| 602 | |
| 603 | func fetchGitHubMeta(client *http.Client, owner, repo, token string) *RepoMeta { |
| 604 | apiURL := fmt.Sprintf("https://api.github.com/repos/%s/%s", owner, repo) |
no test coverage detected