Procházet zdrojové kódy

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>
Simon Barendse před 5 roky
rodič
revize
ea65f0bca2

+ 2 - 1
pkg/parsers/operatingsystem/operatingsystem_unix.go

@@ -6,6 +6,7 @@ import (
 	"errors"
 	"errors"
 	"fmt"
 	"fmt"
 	"os/exec"
 	"os/exec"
+	"strings"
 )
 )
 
 
 // GetOperatingSystem gets the name of the current operating system.
 // GetOperatingSystem gets the name of the current operating system.
@@ -15,7 +16,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.