MCPcopy Index your code
hub / github.com/bytebase/bytebase / extractVersion

Function extractVersion

action/command/file.go:100–108  ·  view source on GitHub ↗

extractVersion extracts version from a string and removes the optional "v" or "V" prefix

(s string)

Source from the content-addressed store, hash-verified

98
99// extractVersion extracts version from a string and removes the optional "v" or "V" prefix
100func extractVersion(s string) string {
101 matches := versionReg.FindStringSubmatch(s)
102 if len(matches) < 2 {
103 return ""
104 }
105
106 // Return the first capture group which contains just the version numbers
107 return matches[1]
108}

Callers 2

TestExtractVersionFunction · 0.85
getReleaseFilesFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestExtractVersionFunction · 0.68