about summary refs log blame commit diff
path: root/main/osinfo/osinfo_darwin.go
blob: 32ead5fe053955218728edf2174a3a96de052aea (plain) (tree)























                                                                                    
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016 Datadog, Inc.

package osinfo

import (
	"os/exec"
	"runtime"
	"strings"
)

func osName() string {
	return runtime.GOOS
}

func osVersion() string {
	out, err := exec.Command("sw_vers", "-productVersion").Output()
	if err != nil {
		return "unknown"
	}
	return strings.Trim(string(out), "\n")
}