MCPcopy Create free account
hub / github.com/cli/cli / changelogURL

Function changelogURL

pkg/cmd/version/version.go:48–57  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

46}
47
48func changelogURL(version string) string {
49 path := "https://github.com/cli/cli"
50 r := regexp.MustCompile(`^v?\d+\.\d+\.\d+(-[\w.]+)?$`)
51 if !r.MatchString(version) {
52 return fmt.Sprintf("%s/releases/latest", path)
53 }
54
55 url := fmt.Sprintf("%s/releases/tag/v%s", path, strings.TrimPrefix(version, "v"))
56 return url
57}

Callers 2

TestChangelogURLFunction · 0.85
formatFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestChangelogURLFunction · 0.68