diff options
Diffstat (limited to 'vendor/github.com/rs/xid/hostid_darwin.go')
-rw-r--r-- | vendor/github.com/rs/xid/hostid_darwin.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/vendor/github.com/rs/xid/hostid_darwin.go b/vendor/github.com/rs/xid/hostid_darwin.go deleted file mode 100644 index 17351563a..000000000 --- a/vendor/github.com/rs/xid/hostid_darwin.go +++ /dev/null @@ -1,34 +0,0 @@ -// +build darwin - -package xid - -import ( - "errors" - "os/exec" - "strings" -) - -func readPlatformMachineID() (string, error) { - ioreg, err := exec.LookPath("ioreg") - if err != nil { - return "", err - } - - cmd := exec.Command(ioreg, "-rd1", "-c", "IOPlatformExpertDevice") - out, err := cmd.CombinedOutput() - if err != nil { - return "", err - } - - for _, line := range strings.Split(string(out), "\n") { - if strings.Contains(line, "IOPlatformUUID") { - parts := strings.SplitAfter(line, `" = "`) - if len(parts) == 2 { - uuid := strings.TrimRight(parts[1], `"`) - return strings.ToLower(uuid), nil - } - } - } - - return "", errors.New("cannot find host id") -} |