mirror of
https://github.com/kidoman/embd
synced 2025-07-04 20:37:46 +02:00
Merge pull request #7 from marcomonteiro/version_parsing_bug_fix
fix a bug parsing version numbers with a hyphen at the end
This commit is contained in:
commit
ccaa5d4909
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue