mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07:00
Merge pull request #550 from unclejack/handle-empty-kernel-flavor-without-dash
* Runtime: kernel version - don't show the dash if flavor is empty
This commit is contained in:
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.
|
||||
|
||||
Reference in New Issue
Block a user