mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix getting the operating system on Darwin
This used to return "Darwin\n", but now returns "Darwin" Signed-off-by: Simon Barendse <simon.barendse@gmail.com>
This commit is contained in:
parent
7ce0e26c16
commit
ea65f0bca2
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// GetOperatingSystem gets the name of the current operating system.
|
||||
|
@ -15,7 +16,7 @@ func GetOperatingSystem() (string, error) {
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(osName), nil
|
||||
return strings.TrimSpace(string(osName)), nil
|
||||
}
|
||||
|
||||
// GetOperatingSystemVersion gets the version of the current operating system, as a string.
|
||||
|
|
Loading…
Reference in a new issue