MCPcopy
hub / github.com/syncthing/syncthing / parseGitHubURL

Function parseGitHubURL

script/copyrights.go:379–390  ·  view source on GitHub ↗
(u string)

Source from the content-addressed store, hash-verified

377}
378
379func parseGitHubURL(u string) (string, string) {
380 parsed, err := url.Parse(u)
381 if err != nil {
382 log.Fatal(err)
383 }
384 parts := strings.Split(strings.Trim(parsed.Path, "/"), "/")
385 if len(parts) < 2 {
386 log.Fatal(fmt.Errorf("invalid GitHub URL: %q", parsed.Path))
387 }
388
389 return parts[0], parts[1]
390}
391
392func getLicenseText(owner, repo string) string {
393 url := fmt.Sprintf("https://api.github.com/repos/%s/%s/license", owner, repo)

Callers 1

mainFunction · 0.85

Calls 2

ParseMethod · 0.80
FatalMethod · 0.80

Tested by

no test coverage detected