Segments returns the numeric segments of the version as a slice of ints. This excludes any metadata or pre-release information. For example, for a version "1.2.3-beta", segments will return a slice of 1, 2, 3.
()
| 338 | // for a version "1.2.3-beta", segments will return a slice of |
| 339 | // 1, 2, 3. |
| 340 | func (v *Version) Segments() []int { |
| 341 | segmentSlice := make([]int, len(v.segments)) |
| 342 | for i, v := range v.segments { |
| 343 | segmentSlice[i] = int(v) |
| 344 | } |
| 345 | return segmentSlice |
| 346 | } |
| 347 | |
| 348 | // Segments64 returns the numeric segments of the version as a slice of int64s. |
| 349 | // |
no outgoing calls