Skip to content

Commit 6c923dc

Browse files
committed
refactoring
1 parent bcc0693 commit 6c923dc

File tree

3 files changed

+1
-39
lines changed

3 files changed

+1
-39
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func printVersion() {
140140
}
141141

142142
func printVersionOnly() {
143-
version0 := GetVersion1()
143+
version0 := GetVersion()
144144
fmt.Println(version0)
145145
os.Exit(0)
146146
}

pkg/pind_test.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

version.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,12 @@ package main
33
import (
44
_ "embed"
55
"runtime/debug"
6-
"strings"
76
)
87

98
const (
109
dev = "dev"
1110
)
1211

13-
// GetVersion1 - return numeric version like 1.0.2 or dev
14-
func GetVersion1() string {
15-
version0 := GetVersion()
16-
if version0 == dev {
17-
return dev
18-
}
19-
20-
l0 := len(version0)
21-
in0 := strings.Index(version0, "v")
22-
if in0 == -1 || in0 >= l0 {
23-
return version0
24-
}
25-
26-
in1 := in0 + 1
27-
return version0[in1:]
28-
}
29-
3012
func GetVersion0() (string, string) {
3113
version0 := GetVersion()
3214
gitHash := GetGitHash()

0 commit comments

Comments
 (0)