MCPcopy Index your code
hub / github.com/crashappsec/github-analyzer / getVersion

Function getVersion

cmd/github-analyzer/main.go:27–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25var version = "(devel)"
26
27func getVersion() (response string) {
28 // inspired from
29 // https://github.com/mvdan/sh/blob/6ba49e2c622e3f56330f4de6238a390f395db2d8/cmd/shfmt/main.go#L181-L192
30 if info, ok := debug.ReadBuildInfo(); ok && version == "(devel)" {
31 mod := &info.Main
32 if mod.Replace != nil {
33 mod = mod.Replace
34 }
35 if mod.Version != "" {
36 version = mod.Version
37 }
38 }
39 return version
40}
41
42func main() {
43 if err := NewRootCommand().Execute(); err != nil {

Callers 1

NewRootCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected