From ea65f0bca2f778412a3ca1b662eb70ee23903fae Mon Sep 17 00:00:00 2001 From: Simon Barendse Date: Thu, 29 Aug 2019 16:58:38 +0200 Subject: [PATCH] Fix getting the operating system on Darwin This used to return "Darwin\n", but now returns "Darwin" Signed-off-by: Simon Barendse --- pkg/parsers/operatingsystem/operatingsystem_unix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/parsers/operatingsystem/operatingsystem_unix.go b/pkg/parsers/operatingsystem/operatingsystem_unix.go index fcc693da27..9b8b2cd19a 100644 --- a/pkg/parsers/operatingsystem/operatingsystem_unix.go +++ b/pkg/parsers/operatingsystem/operatingsystem_unix.go @@ -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.