File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func (b *BuildInfo) GetSemanticVersion() string {
32
32
return emptyValue
33
33
}
34
34
35
- return fmt . Sprintf ( "v%s" , b .SemanticVersion )
35
+ return b .SemanticVersion
36
36
}
37
37
38
38
func (b * BuildInfo ) CommitShortSha () string {
Original file line number Diff line number Diff line change @@ -29,11 +29,17 @@ func TestGetSemanticVersion(t *testing.T) {
29
29
{
30
30
name : "Non-empty Semantic Version" ,
31
31
buildInfo : BuildInfo {
32
- SemanticVersion : "1 .2.3" ,
32
+ SemanticVersion : "v1 .2.3" ,
33
33
},
34
34
expectedVersion : "v1.2.3" ,
35
35
},
36
- // Add more test cases as needed
36
+ {
37
+ name : "Non-empty Semantic Version without v prefix" ,
38
+ buildInfo : BuildInfo {
39
+ SemanticVersion : "1.2.3" ,
40
+ },
41
+ expectedVersion : "1.2.3" ,
42
+ },
37
43
}
38
44
39
45
for _ , tc := range tests {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ func TestUserAgent(t *testing.T) {
20
20
tp : node .Full ,
21
21
expected : "celestia-node/testnet/full/v1.0.0/abcdefg" ,
22
22
build : & node.BuildInfo {
23
- SemanticVersion : "1 .0.0" ,
23
+ SemanticVersion : "v1 .0.0" ,
24
24
LastCommit : "abcdefg" ,
25
25
},
26
26
},
@@ -30,7 +30,7 @@ func TestUserAgent(t *testing.T) {
30
30
expected : "celestia-node/mainnet/light/v1.0.0/abcdefg" ,
31
31
tp : node .Light ,
32
32
build : & node.BuildInfo {
33
- SemanticVersion : "1 .0.0" ,
33
+ SemanticVersion : "v1 .0.0" ,
34
34
LastCommit : "abcdefg" ,
35
35
},
36
36
},
You can’t perform that action at this time.
0 commit comments