mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-05 10:02:47 +00:00
f924297af1
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.75 to 7.0.76. - [Release notes](https://github.com/minio/minio-go/releases) - [Commits](https://github.com/minio/minio-go/compare/v7.0.75...v7.0.76) --- updated-dependencies: - dependency-name: github.com/minio/minio-go/v7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
35 lines
657 B
Go
35 lines
657 B
Go
// +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")
|
|
}
|