(opts *ContentOpts, owner, repo, path string)
| 42 | } |
| 43 | |
| 44 | func (c *Client) URLFromOpts(opts *ContentOpts, owner, repo, path string) string { |
| 45 | if opts == nil { |
| 46 | opts = &ContentOpts{} |
| 47 | } |
| 48 | if opts.SHA != "" { |
| 49 | return c.commitURL(owner, repo, opts.SHA, path) |
| 50 | } |
| 51 | return c.refURL(owner, repo, opts.Ref, path) |
| 52 | } |
| 53 | |
| 54 | // BlobURL returns the URL for a blob in the raw content API. |
| 55 | func (c *Client) commitURL(owner, repo, sha, path string) string { |