Просмотр исходного кода

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 6 лет назад
Родитель
Сommit
ea65f0bca2
1 измененных файлов с 2 добавлено и 1 удалено
  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.