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

Function buildRevision

script/ghmock/export.go:221–240  ·  view source on GitHub ↗

buildRevision is the commit ghmock was built from, if Go recorded it.

()

Source from the content-addressed store, hash-verified

219
220// buildRevision is the commit ghmock was built from, if Go recorded it.
221func buildRevision() string {
222 info, ok := debug.ReadBuildInfo()
223 if !ok {
224 return ""
225 }
226 var revision string
227 modified := false
228 for _, s := range info.Settings {
229 switch s.Key {
230 case "vcs.revision":
231 revision = s.Value
232 case "vcs.modified":
233 modified = s.Value == "true"
234 }
235 }
236 if revision != "" && modified {
237 revision += ", with local changes"
238 }
239 return revision
240}

Callers 1

exportReadmeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected