mirror of
https://github.com/kidoman/embd
synced 2024-12-22 21:00:05 +01:00
fixes a bug parsing version numbers with a hyphen at the end
This commit is contained in:
parent
6570792356
commit
6c98eeb15f
@ -46,7 +46,8 @@ func nodeName() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseVersion(str string) (major, minor, patch int, err error) {
|
func parseVersion(str string) (major, minor, patch int, err error) {
|
||||||
parts := strings.Split(str, ".")
|
versionNumber := strings.Split(str, "-")
|
||||||
|
parts := strings.Split(versionNumber[0], ".")
|
||||||
len := len(parts)
|
len := len(parts)
|
||||||
|
|
||||||
if major, err = strconv.Atoi(parts[0]); err != nil {
|
if major, err = strconv.Atoi(parts[0]); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user