osinfo_freebsd.go 507 B

123456789101112131415161718192021222324
  1. // Unless explicitly stated otherwise all files in this repository are licensed
  2. // under the Apache License Version 2.0.
  3. // This product includes software developed at Datadog (https://www.datadoghq.com/).
  4. // Copyright 2016 Datadog, Inc.
  5. package osinfo
  6. import (
  7. "os/exec"
  8. "runtime"
  9. "strings"
  10. )
  11. func osName() string {
  12. return runtime.GOOS
  13. }
  14. func osVersion() string {
  15. out, err := exec.Command("uname", "-r").Output()
  16. if err != nil {
  17. return "unknown"
  18. }
  19. return strings.Split(string(out), "-")[0]
  20. }