Forráskód Böngészése

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 5 éve
szülő
commit
ea65f0bca2
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      pkg/parsers/operatingsystem/operatingsystem_unix.go

+ 2 - 1
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.