MCPcopy Create free account
hub / github.com/ethereum/node-crawler / parseVersionNumber

Function parseVersionNumber

pkg/vparser/vparser.go:140–160  ·  view source on GitHub ↗
(input string)

Source from the content-addressed store, hash-verified

138}
139
140func parseVersionNumber(input string) (int, int, int) {
141 // Version
142 trimmed := strings.TrimLeft(input, "v")
143 vSplit := strings.Split(trimmed, ".")
144 var major, minor, patch int
145
146 switch len(vSplit) {
147 case 4:
148 fallthrough
149 case 3:
150 patch, _ = strconv.Atoi(vSplit[2])
151 fallthrough
152 case 2:
153 minor, _ = strconv.Atoi(vSplit[1])
154 fallthrough
155 case 1:
156 major, _ = strconv.Atoi(vSplit[0])
157 }
158
159 return major, minor, patch
160}
161
162func parseOS(input string) OSInfo {
163 split := strings.Split(input, "-")

Callers 1

parseVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected