kernel version - don't show the dash if flavor is empty
This commit is contained in:
parent
f46ab22b7a
commit
d2eb2455a1
6
utils.go
6
utils.go
|
@ -425,7 +425,11 @@ func GetKernelVersion() (*KernelVersionInfo, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k *KernelVersionInfo) String() string {
|
func (k *KernelVersionInfo) String() string {
|
||||||
return fmt.Sprintf("%d.%d.%d-%s", k.Kernel, k.Major, k.Minor, k.Flavor)
|
flavor := ""
|
||||||
|
if len(k.Flavor) > 0 {
|
||||||
|
flavor = fmt.Sprintf("-%s", k.Flavor)
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%d.%d.%d%s", k.Kernel, k.Major, k.Minor, flavor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compare two KernelVersionInfo struct.
|
// Compare two KernelVersionInfo struct.
|
||||||
|
|
Loading…
Reference in New Issue