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

Function format

pkg/cmd/version/version.go:32–46  ·  view source on GitHub ↗
(version, buildDate string, debugBuild bool)

Source from the content-addressed store, hash-verified

30}
31
32func format(version, buildDate string, debugBuild bool) string {
33 version = strings.TrimPrefix(version, "v")
34
35 var dateStr string
36 if buildDate != "" {
37 dateStr = fmt.Sprintf(" (%s)", buildDate)
38 }
39
40 var debugStr string
41 if debugBuild {
42 debugStr = " [debug build]"
43 }
44
45 return fmt.Sprintf("gh version %s%s%s\n%s\n", version, dateStr, debugStr, changelogURL(version))
46}
47
48func changelogURL(version string) string {
49 path := "https://github.com/cli/cli"

Callers 3

TestFormatFunction · 0.85
TestFormatDebugBuildFunction · 0.85
FormatFunction · 0.85

Calls 1

changelogURLFunction · 0.85

Tested by 2

TestFormatFunction · 0.68
TestFormatDebugBuildFunction · 0.68