File tree 3 files changed +6
-7
lines changed
3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ var FLAG_V1_1 = flagSpecs[1]
17
17
var FLAG_V1_2 = flagSpecs [2 ]
18
18
19
19
var Latest = string (flagSpecs [len (flagSpecs )- 1 ])
20
- var Default = string (flagSpecs [0 ])
21
20
22
21
// Match returns the spec version if it is valid, otherwise it returns nil
23
22
func Match (version string ) * string {
@@ -32,7 +31,7 @@ func Match(version string) *string {
32
31
func ParseAndValidate (spec string ) (string , error ) {
33
32
if len (spec ) == 0 {
34
33
// return default flag spec
35
- return Default , nil
34
+ return FLAG_V1_0 , nil
36
35
}
37
36
38
37
if Match (spec ) == nil {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ func NewSplitVersionFilter() SplitVersionFilter {
13
13
FLAG_V1_1 : {matchers .MatcherTypeInLargeSegment : true },
14
14
}
15
15
16
- data [Default ] = mergeMaps (map [string ]bool {
16
+ data [FLAG_V1_0 ] = mergeMaps (map [string ]bool {
17
17
matchers .MatcherEqualToSemver : true ,
18
18
matchers .MatcherTypeLessThanOrEqualToSemver : true ,
19
19
matchers .MatcherTypeGreaterThanOrEqualToSemver : true ,
Original file line number Diff line number Diff line change 8
8
9
9
func TestParseAndValidate (t * testing.T ) {
10
10
res , err := ParseAndValidate ("" )
11
- if err != nil || res != Default {
11
+ if err != nil || res != FLAG_V1_0 {
12
12
t .Error ("It should be 1.1" )
13
13
}
14
14
@@ -30,12 +30,12 @@ func TestParseAndValidate(t *testing.T) {
30
30
31
31
func TestSplitVersionFilter (t * testing.T ) {
32
32
filter := NewSplitVersionFilter ()
33
- shouldFilter := filter .ShouldFilter (matchers .MatcherTypeBetweenSemver , Default )
33
+ shouldFilter := filter .ShouldFilter (matchers .MatcherTypeBetweenSemver , FLAG_V1_0 )
34
34
if ! shouldFilter {
35
35
t .Error ("It should filtered" )
36
36
}
37
37
38
- shouldFilter = filter .ShouldFilter (matchers .MatcherTypeEqualTo , Default )
38
+ shouldFilter = filter .ShouldFilter (matchers .MatcherTypeEqualTo , FLAG_V1_0 )
39
39
if shouldFilter {
40
40
t .Error ("It should not filtered" )
41
41
}
@@ -45,7 +45,7 @@ func TestSplitVersionFilter(t *testing.T) {
45
45
t .Error ("It should not filtered" )
46
46
}
47
47
48
- shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , Default )
48
+ shouldFilter = filter .ShouldFilter (matchers .MatcherTypeInLargeSegment , FLAG_V1_0 )
49
49
if ! shouldFilter {
50
50
t .Error ("It should filtered" )
51
51
}
You can’t perform that action at this time.
0 commit comments