(subpath string)
| 132 | } |
| 133 | |
| 134 | func (p *githubPlugin) url(subpath string) (string, error) { |
| 135 | // Github redirects "master" to "main" in new repos. They don't do the reverse |
| 136 | // so setting master here is better. |
| 137 | return url.JoinPath( |
| 138 | "https://raw.githubusercontent.com/", |
| 139 | p.ref.Owner, |
| 140 | p.ref.Repo, |
| 141 | cmp.Or(p.ref.Rev, p.ref.Ref, "master"), |
| 142 | p.ref.Dir, |
| 143 | subpath, |
| 144 | ) |
| 145 | } |
| 146 | |
| 147 | func (p *githubPlugin) request(contentURL string) (*http.Request, error) { |
| 148 | req, err := http.NewRequest(http.MethodGet, contentURL, nil) |
no outgoing calls