1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #39825 from secrethub/fix/os-darwin

Fix getting the operating system on Darwin
This commit is contained in:
Sebastiaan van Stijn 2019-08-30 15:38:47 +02:00 committed by GitHub
commit 1cfc3060a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ package operatingsystem // import "github.com/docker/docker/pkg/parsers/operatin
import ( import (
"errors" "errors"
"os/exec" "os/exec"
"strings"
) )
// GetOperatingSystem gets the name of the current operating system. // GetOperatingSystem gets the name of the current operating system.
@ -14,7 +15,7 @@ func GetOperatingSystem() (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
return string(osName), nil return strings.TrimSpace(string(osName)), nil
} }
// GetOperatingSystemVersion gets the version of the current operating system, as a string. // GetOperatingSystemVersion gets the version of the current operating system, as a string.