| 1 | package versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.15 fmt/" |
| 5 | "strconvscip-go gomod github.com/golang/go/src go1.15 strconv/" |
| 6 | "stringsscip-go gomod github.com/golang/go/src go1.15 strings/" |
| 7 | ) |
| 8 | |
| 9 | var ( |
| 10 | Qualifiersscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Qualifiers. = []string{"alpha", "beta", "milestone", "rc", "snapshot", "", "sp"} |
| 11 | Aliasesscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Aliases. = map[string]string{"ga": "", "final": "", "release": "", "cr": "rc"} |
| 12 | ReleaseVersionIndexscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ReleaseVersionIndex. = fmtscip-go gomod github.com/golang/go/src go1.15 fmt/.Sprintscip-go gomod github.com/golang/go/src go1.15 fmt/Sprint().(indexOfscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/indexOf().("", Qualifiersscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Qualifiers.)) |
| 13 | ) |
| 14 | |
| 15 | type Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version# struct { |
| 16 | Valuescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Value. string |
| 17 | Itemsscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Items. ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem# |
| 18 | } |
| 19 | |
| 20 | func NewVersionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/NewVersion().(v string) (Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#, error) { |
| 21 | return Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#{ |
| 22 | Valuescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Value.: v, |
| 23 | Itemsscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Items.: parseVersionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/parseVersion().(v), |
| 24 | }, nil |
| 25 | } |
| 26 | |
| 27 | func (v1 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) Stringscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#String().() string { |
| 28 | return v1.Valuescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Value. |
| 29 | } |
| 30 | |
| 31 | func (v1 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Compare().(v2 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) int { |
| 32 | return v1.Itemsscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Items..Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#Compare().(v2.Itemsscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Items.) |
| 33 | } |
| 34 | |
| 35 | func (v1 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) Equalscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Equal().(v2 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) bool { |
| 36 | return v1.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Compare().(v2) == 0 |
| 37 | } |
| 38 | |
| 39 | func (v1 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) GreaterThanscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#GreaterThan().(v2 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) bool { |
| 40 | return v1.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Compare().(v2) > 0 |
| 41 | } |
| 42 | |
| 43 | func (v1 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) LessThanscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#LessThan().(v2 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) bool { |
| 44 | return v1.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Compare().(v2) < 0 |
| 45 | } |
| 46 | |
| 47 | func (v1 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) GreaterThanOrEqualscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#GreaterThanOrEqual().(v2 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) bool { |
| 48 | return v1.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Compare().(v2) >= 0 |
| 49 | } |
| 50 | |
| 51 | func (v1 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) LessThanOrEqualscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#LessThanOrEqual().(v2 Versionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#) bool { |
| 52 | return v1.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Version#Compare().(v2) <= 0 |
| 53 | } |
| 54 | |
| 55 | type Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item# interface { |
| 56 | Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#Compare.(v2 Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#) int |
| 57 | isNullscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#isNull.() bool |
| 58 | } |
| 59 | |
| 60 | func parseItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/parseItem().(isDigit bool, item string) Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item# { |
| 61 | if isDigit { |
| 62 | i, _ := strconvscip-go gomod github.com/golang/go/src go1.15 strconv/.Atoiscip-go gomod github.com/golang/go/src go1.15 strconv/Atoi().(item) |
| 63 | return IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#(i) |
| 64 | } |
| 65 | return newStringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/newStringItem().(item, false) |
| 66 | } |
| 67 | |
| 68 | type IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem# int |
| 69 | |
| 70 | func (item1 IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#) Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#Compare().(item2 Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#) int { |
| 71 | if item2 == nil { |
| 72 | if item1 == 0 { |
| 73 | return 0 |
| 74 | } |
| 75 | return 1 // 1.0 == 1, 1.1 > 1 |
| 76 | } |
| 77 | |
| 78 | switch t := item2.(type) { |
| 79 | case IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#: |
| 80 | return compareIntscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/compareInt().(int(item1), int(t)) |
| 81 | case StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#: |
| 82 | return 1 // 1.1 > 1-sp |
| 83 | case ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#: |
| 84 | return 1 // 1.1 > 1-1 |
| 85 | } |
| 86 | return 0 |
| 87 | } |
| 88 | |
| 89 | func (item1 IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#) isNullscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#isNull().() bool { |
| 90 | return item1 == 0 |
| 91 | } |
| 92 | |
| 93 | type StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem# string |
| 94 | |
| 95 | func newStringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/newStringItem().(value string, followedByDigit bool) StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem# { |
| 96 | if followedByDigit { |
| 97 | switch value { |
| 98 | case "a": |
| 99 | return "alpha" |
| 100 | case "b": |
| 101 | return "beta" |
| 102 | case "m": |
| 103 | return "milestone" |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | v, ok := Aliasesscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Aliases.[value] |
| 108 | if ok { |
| 109 | return StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#(v) |
| 110 | } |
| 111 | return StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#(value) |
| 112 | } |
| 113 | |
| 114 | func (item1 StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#) Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#Compare().(item2 Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#) int { |
| 115 | if item2 == nil { |
| 116 | // 1-rc < 1, 1-ga > 1 |
| 117 | return stringsscip-go gomod github.com/golang/go/src go1.15 strings/.Comparescip-go gomod github.com/golang/go/src go1.15 strings/Compare().(item1.comparableQualifierscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#comparableQualifier().(), ReleaseVersionIndexscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ReleaseVersionIndex.) |
| 118 | } |
| 119 | |
| 120 | switch v := item2.(type) { |
| 121 | case IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#: |
| 122 | return -1 |
| 123 | case StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#: |
| 124 | return stringsscip-go gomod github.com/golang/go/src go1.15 strings/.Comparescip-go gomod github.com/golang/go/src go1.15 strings/Compare().(item1.comparableQualifierscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#comparableQualifier().(), v.comparableQualifierscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#comparableQualifier().()) |
| 125 | case ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#: |
| 126 | return -1 // 1.any < 1-1 |
| 127 | } |
| 128 | return 0 |
| 129 | } |
| 130 | |
| 131 | func (item1 StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#) isNullscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#isNull().() bool { |
| 132 | return item1 == "" |
| 133 | } |
| 134 | |
| 135 | func (item1 StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#) comparableQualifierscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#comparableQualifier().() string { |
| 136 | index := indexOfscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/indexOf().(string(item1), Qualifiersscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Qualifiers.) |
| 137 | if index == -1 { |
| 138 | return fmtscip-go gomod github.com/golang/go/src go1.15 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.15 fmt/Sprintf().("%d-%s", len(Qualifiersscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Qualifiers.), item1) |
| 139 | } |
| 140 | return fmtscip-go gomod github.com/golang/go/src go1.15 fmt/.Sprintscip-go gomod github.com/golang/go/src go1.15 fmt/Sprint().(index) |
| 141 | } |
| 142 | |
| 143 | func indexOfscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/indexOf().(s string, sa []string) int { |
| 144 | for i, q := range sa { |
| 145 | if q == s { |
| 146 | return i |
| 147 | } |
| 148 | } |
| 149 | return -1 |
| 150 | } |
| 151 | |
| 152 | type ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem# []Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item# |
| 153 | |
| 154 | func (items1 ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#) Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#Compare().(item2 Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#) int { |
| 155 | if item2 == nil { |
| 156 | if len(items1) == 0 { |
| 157 | return 0 // 1-0 = 1- (normalize) = 1 |
| 158 | } |
| 159 | // Compare the entire list of items with null - not just the first one, MNG-6964 |
| 160 | for _, item := range items1 { |
| 161 | if result := item.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#Compare.(nil); result != 0 { |
| 162 | return result |
| 163 | } |
| 164 | } |
| 165 | return 0 |
| 166 | } |
| 167 | |
| 168 | switch v := item2.(type) { |
| 169 | case IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#: |
| 170 | return -1 // 1-1 < 1.0.x |
| 171 | case StringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/StringItem#: |
| 172 | return 1 // 1-1 > 1-sp |
| 173 | case ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#: |
| 174 | iter := zipscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/zip().(items1, v) |
| 175 | for tuple := iter(); tuple != nil; tuple = iter() { |
| 176 | l, r := tuple[0], tuple[1] |
| 177 | |
| 178 | var result int |
| 179 | if l == nil { |
| 180 | // if this is shorter, then invert the compare and mul with -1 |
| 181 | result = -1 * r.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#Compare.(l) |
| 182 | } else { |
| 183 | result = l.Comparescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#Compare.(r) |
| 184 | } |
| 185 | if result != 0 { |
| 186 | return result |
| 187 | } |
| 188 | } |
| 189 | return 0 |
| 190 | } |
| 191 | return 0 |
| 192 | } |
| 193 | |
| 194 | func (items1 ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#) isNullscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#isNull().() bool { |
| 195 | return len(items1) == 0 |
| 196 | } |
| 197 | |
| 198 | func (items1 ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#) normalizescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#normalize().() ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem# { |
| 199 | ret := items1 |
| 200 | for i := len(items1) - 1; i >= 0; i-- { |
| 201 | lastItem := items1[i] |
| 202 | if lastItem.isNullscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#isNull.() { |
| 203 | ret = ret[:i] |
| 204 | } else if _, ok := lastItem.(ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#); !ok { |
| 205 | break |
| 206 | } |
| 207 | } |
| 208 | return ret |
| 209 | } |
| 210 | |
| 211 | func zipscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/zip().(a, b ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#) func() []Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item# { |
| 212 | i := 0 |
| 213 | return func() []Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item# { |
| 214 | var item1, item2 Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item# |
| 215 | if i < len(a) { |
| 216 | item1 = a[i] |
| 217 | } |
| 218 | if i < len(b) { |
| 219 | item2 = b[i] |
| 220 | } |
| 221 | if item1 == nil && item2 == nil { |
| 222 | return nil |
| 223 | } |
| 224 | i++ |
| 225 | return []Itemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/Item#{item1, item2} |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // parseVersion is normalize version string. |
| 230 | func parseVersionscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/parseVersion().(v string) ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem# { |
| 231 | stack := new(ListItemStackscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#) |
| 232 | var list ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem# |
| 233 | |
| 234 | isDigit := false |
| 235 | startIndex := 0 |
| 236 | str := stringsscip-go gomod github.com/golang/go/src go1.15 strings/.ToLowerscip-go gomod github.com/golang/go/src go1.15 strings/ToLower().(v) |
| 237 | sa := stringsscip-go gomod github.com/golang/go/src go1.15 strings/.Splitscip-go gomod github.com/golang/go/src go1.15 strings/Split().(str, "") |
| 238 | for i, c := range sa { |
| 239 | if c == "." { |
| 240 | if i == startIndex { |
| 241 | list = append(list, IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#(0)) |
| 242 | } else { |
| 243 | list = append(list, parseItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/parseItem().(isDigit, str[startIndex:i])) |
| 244 | } |
| 245 | startIndex = i + 1 |
| 246 | } else if c == "-" { |
| 247 | if i == startIndex { |
| 248 | list = append(list, IntItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/IntItem#(0)) |
| 249 | } else { |
| 250 | list = append(list, parseItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/parseItem().(isDigit, str[startIndex:i])) |
| 251 | } |
| 252 | startIndex = i + 1 |
| 253 | |
| 254 | stack.Pushscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#Push().(list) |
| 255 | list = ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#{} |
| 256 | |
| 257 | } else if _, err := strconvscip-go gomod github.com/golang/go/src go1.15 strconv/.Atoiscip-go gomod github.com/golang/go/src go1.15 strconv/Atoi().(c); err == nil { |
| 258 | if !isDigit && i > startIndex { |
| 259 | list = append(list, newStringItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/newStringItem().(str[startIndex:i], true)) |
| 260 | startIndex = i |
| 261 | |
| 262 | stack.Pushscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#Push().(list) |
| 263 | list = ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#{} |
| 264 | } |
| 265 | |
| 266 | isDigit = true |
| 267 | } else { |
| 268 | if isDigit && i > startIndex { |
| 269 | list = append(list, parseItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/parseItem().(true, str[startIndex:i])) |
| 270 | startIndex = i |
| 271 | |
| 272 | stack.Pushscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#Push().(list) |
| 273 | list = ListItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#{} |
| 274 | } |
| 275 | isDigit = false |
| 276 | } |
| 277 | } |
| 278 | if len(v) > startIndex { |
| 279 | list = append(list, parseItemscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/parseItem().(isDigit, str[startIndex:])) |
| 280 | stack.Pushscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#Push().(list) |
| 281 | } |
| 282 | |
| 283 | if stack.IsEmptyscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#IsEmpty().() { |
| 284 | stack.Pushscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#Push().(list) |
| 285 | } |
| 286 | |
| 287 | ret := stack.Popscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#Pop().().normalizescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#normalize().() |
| 288 | for !stack.IsEmptyscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#IsEmpty().() { |
| 289 | ret = append(stack.Popscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItemStack#Pop().().normalizescip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/ListItem#normalize().(), ret) |
| 290 | } |
| 291 | return ret |
| 292 | } |
| 293 | |
| 294 | func compareIntscip-go gomod github.com/masahiro331/go-mvn-version . `github.com/masahiro331/go-mvn-version`/compareInt().(a, b int) int { |
| 295 | if a == b { |
| 296 | return 0 |
| 297 | } else if a > b { |
| 298 | return 1 |
| 299 | } |
| 300 | return -1 |
| 301 | } |