hashicorp / hashicorp/go-version

Malformed version for linux kernel

Open
#70 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.8k
Forks
165
Avg merge
23h 42m
Merged PRs (30d)
2

Description

when trying to create a newVersion for the amazon1/2 (and other distros) kernel version (output of uname -r) it reports a Malformed version.
for example: 4.14.77-70.59.amzn1.x86_64
A short investigation shows that the "_" in the x86_64 is the problem.

A short code to reproduce it:
package main

import (
"fmt"
version "github.com/hashicorp/go-version"
)

func main() {
v1, err := version.NewVersion("4.4.23-31.54.amzn1.x86_64")
if err != nil {
fmt.Printf("Error %v\n", err)
return
} else {
fmt.Printf("Got version %v\n", v1)
}
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.