mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
kernel version - don't show the dash if flavor is empty
This commit is contained in:
parent
f46ab22b7a
commit
d2eb2455a1
1 changed files with 5 additions and 1 deletions
6
utils.go
6
utils.go
|
@ -425,7 +425,11 @@ func GetKernelVersion() (*KernelVersionInfo, error) {
|
|||
}
|
||||
|
||||
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.
|
||||
|
|
Loading…
Add table
Reference in a new issue